![]() |
|
"be consistent" | |
PerlMonks |
Re: Re: How's your Perl?by davido (Cardinal) |
on Oct 27, 2003 at 04:04 UTC ( #302325=note: print w/replies, xml ) | Need Help?? |
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
|
|