Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Perl class - how to create instance variable instead of class variable

by Anno (Deacon)
on Aug 29, 2007 at 17:39 UTC ( [id://635878]=note: print w/replies, xml ) Need Help??


in reply to Perl class - how to create instance variable instead of class variable

Fletch has already pointed out the basic error. One of your comments seems to indicate another, probably related, misunderstanding. You write:

I am surprised that test1 "steps on" test because the hash keys are different for test and test1.

The hash keys are the same in both instances, namely theValue according to your code. What should have been different (but wasn't) are the hashes, namely the anonymous hashes references to which are your objects $test and $test1.

Anno

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://635878]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-23 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found