Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 avoiding work at the Monastery: (6)
As of 2018-02-19 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (264 votes). Check out past polls.

    Notices?