in reply to Re: Making a variable in a sub retain its value between calls
in thread Making a variable in a sub retain its value between calls

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.