We don't bite newbies here... much | |
PerlMonks |
Re: Re: Re: Re: Re: correct usage of class attributesby gjb (Vicar) |
on May 05, 2004 at 15:02 UTC ( [id://350802]=note: print w/replies, xml ) | Need Help?? |
Simple: $self->{friends} = ['John', 'Marie'];, or to add something to that list: push(@{$self->{friends}}, 'Jane');. Same story for hashes: $self->{pets}->{dogs} = 'mike' You may want to have a look at the tutorials on references and data structures in the perldocs (since the site is down, I can't link you now). Hope this helps, -gjb-
In Section
Seekers of Perl Wisdom
|
|