Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

( #36524=categorized answer: print w/ replies, xml ) Need Help??

Q&A > object-oriented programming > having difficulty getting $self back from an _init() function 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}; ... }

Comment on Answer: having difficulty getting $self back from an _init() function
Select or Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2015-08-01 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls