![]() |
|
Just another Perl shrine | |
PerlMonks |
comment on |
( #3333=superdoc: 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 reply to Re: Re: How's your Perl?
by davido
|
|