(RADIATOR) perl sanity check

Hugh Irvine hugh at open.com.au
Wed Apr 17 17:45:23 CDT 2002


Hello Dave -

In general Perl usage, "$self" is a reference to an instance of a particular 
class. In this case, the Class is "AttrVal" and "sub new" creates the new 
instance. 

The routine "add_attr" adds an attribute/value pair to a radius packet, 
usually refered to in the code as "$p" (the incoming request) and "$rp" (the 
reply being prepared to send back).

regards

Hugh


On Thu, 18 Apr 2002 05:50, Dave Kitabjian wrote:
> I need some basic perl help here from y'all.
>
> Given the clip of Radiator perl code below, does this mean that
>
> $self is a reference
> to an object
> which is an array
> of references
> to arrays
> which contain 2 elements each, attribute and value?
>
> Dave
>
> ________________________________
>
> # AttrVal.pm
> #
> # Heres a little class for holding attribute value pairs
> # Handles multiple instances of the same attribute.
> # Author: Mike McCauley (mikem at open.com.au)
> # Copyright (C) 1997 Open System Consultants
> # $Id: AttrVal.pm,v 1.17 2001/04/25 23:47:13 mikem Exp $
>
> package Radius::AttrVal;
>
> #####################################################################
> sub new
> {
>     my ($class) = @_;
>
>     my $self = {};
>     bless $self, $class;
>
>     @{$self->{Attributes}} = (); # Define an empty array
>
>     return $self;
> }
>
> #####################################################################
> sub add_attr
> {
>     my ($self, $name, $value) = @_;
>     push(@{$self->{Attributes}}, [ $name, $value ]);
> }
>
> #####################################################################
> ...
> ===
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.

===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list