Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Re: Re: Re: Re: correct usage of class attributes

by gjb (Vicar)
on May 05, 2004 at 15:02 UTC ( #350802=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Re: Re: correct usage of class attributes
in thread correct usage of class attributes

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-

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://350802]
[shmem]: LanX can get the logs from cbstream at any time from me.
shmem relocates to the pub over the street. Have a nice time.
[LanX]: well .. not so much interested in reading this article
[LanX]: my 2 cents: AngloZionistic sounds like an antisemtic theory, but to be critical of zionism doesn't mean to be anti-semitic
[shmem]: it hasn't been coined as a *mustread* without authority from the promoter
erix shoots an anti-bubble missile towards LanX
[LanX]: I don't have the time to go into depth of this blog though
[LanX]: anti-bubble missile?
[shmem]: LanX, it's not a matter of time, and you know that.
[shmem]: be precise.

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2018-03-19 21:35 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (246 votes). Check out past polls.