Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: OO doesn't seem to play nice with multiple instances

by Transient (Hermit)
on Jun 01, 2005 at 21:07 UTC ( [id://462660]=note: print w/replies, xml ) Need Help??


in reply to OO doesn't seem to play nice with multiple instances

your $_name is essentially a package variable.

If you want it tied to each instance, relate it to $this, e.g.:
sub myNameIs { ... #$_name = $name; don't to this, everyone will have the same name $this->{name} = $name; ... }
likewise on whoAmI.

(...gives merlyn the honor post about ref($proto) || $proto)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (1)
As of 2024-04-19 00:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found