Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Garbage collected class attributes with inside out classes.

by rir (Vicar)
on Mar 02, 2007 at 03:50 UTC ( [id://602823]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Garbage collected class attributes with inside out classes.
in thread Garbage collected class attributes with inside out classes.

Just that I'd limit the counter variable to the routines that need it; so it seems that the variable doesn't exist in parts of your class that are outside the scope created by the outermost brackets below.
{ my $count; # Number of class instances that exist. sub BUILD { ++$count; # } sub DEMOLISH { --$count; # } }
Be well,
rir

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://602823]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-20 06:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found