Assuming I am defining an object which has as its only property a level
associated with it, would these be the correct simple subroutines to
retrieve and set that property. Also, is this the correct usage of the @_
array such that the level value would be 999 unless I called new(Level =>
something else)
sub new {
my $invocant = shift;
my $class = ref($invocant) || $invocant;
my $self = {
Level => 999,
@_,
};
return bless $self,$class;
}
sub getlevel {
return $$self{Level};
}
sub setlevel {
$$self{Level} = shift(@_);
}
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com