in reply to Re: How's your Perl?
in thread How's your Perl?

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:

sub { my $x; $x = \$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.


"If I had my life to live over again, I'd be a plumber." -- Albert Einstein