Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2016-10-01 05:34 GMT
Find Nodes?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:

    Results (575 votes). Check out past polls.