Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2017-07-20 17:42 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (311 votes). Check out past polls.