|
|
| Do you know where your variables are? | |
| PerlMonks |
Re: Re: How's your Perl?by davido (Cardinal) |
| on Oct 26, 2003 at 23:04 UTC ( [id://302325]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Though I'm almost certain that's what the OP had in mind, it relies on a bug rather than a documented feaure. For that reason I happen to like this solution to question #5 of the OP's quiz:
Updated version that creates only one $x:
The anonymous sub is created and immediately falls out of existance because it's not passed to a scalar variable. And yet $x never disappears because its reference count is always going to be 1; it refers to itself. It probably doesn't qualify as a static, and is pretty much useless, but it meets the definition of static that the OP gave.
Dave "If I had my life to live over again, I'd be a plumber." -- Albert Einstein
In Section
Meditations
|
|
||||||||||||||||||||||||||||||||||||||||||||||