use User; package Community; sub new { my $self = shift; $self = {}; my @tmp = (); $self -> { USERS } = \@tmp; return bless $self; } sub adduser { # add a User object to this container object my $self = shift; my $aref = $self -> { USER }; push @$aref, shift(); } sub retch { # destructive random fetch of User # from this container object my $self = shift; my $aref = $self -> { USER }; return splice( @$aref, rand() * $#$aref ); } 1;
-M
Free your mind
In reply to Re: Perl OO - Class Data
by Moron
in thread Perl OO - Class Data
by yoda54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |