Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Answer: having difficulty getting $self back from an _init() function

by Fastolfe (Vicar)
on Oct 13, 2000 at 02:10 UTC ( #36524=categorized answer: print w/replies, xml ) Need Help??

Q&A > object-oriented programming > having difficulty getting $self back from an _init() function - Answer contributed by Fastolfe

In your init function, you are changing $self, creating a new hash reference. This destroys the associations it's had before. If you want to add some items to $self, set them individually:
sub _init { ... $self->{modules} = { %registry }; $self->{site} = $regattrs{site}; ... }

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-02-22 12:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (327 votes). Check out past polls.