http://www.perlmonks.org?node_id=262762


in reply to Re: (tye)Re2: A Real Closure
in thread Unusual Closure Behaviour

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 } }