I've also used that behaviour to get less-global shared variables. I was working around an even uglier problem and this isn't the sort of thing I'd recommend for general usage but it is another useful usage.
{ my $x=0; sub foo { $x } sub bar { $x } }In reply to Re: Re: (tye)Re2: A Real Closure
by diotalevi
in thread Unusual Closure Behaviour
by tachyon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |