good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^2: Making a variable in a sub retain its value between callsby crashtest (Curate) |
on Apr 19, 2005 at 16:39 UTC ( [id://449324]=note: print w/replies, xml ) | Need Help?? |
Thanks for the catch! I'm not initializing the variable in my actual code, and only set $memory = 0 in my post on a whim. But it illustrated a subtlety I would have probably missed on my own. And your comment seems to have sparked a lively and interesting debate on BEGIN vs. INIT blocks.
In Section
Seekers of Perl Wisdom
|
|