XP is just a number | |
PerlMonks |
Re: Closure Over Scalar?by LanX (Saint) |
on Feb 18, 2021 at 16:03 UTC ( [id://11128526]=note: print w/replies, xml ) | Need Help?? |
you initialize my $FIXED_STRING = 'fixed_string'; only AFTER calling the sub. Not really a closure problem, could happen with package vars too. One best practice to avoid such problems is to use a "generator sub" with the whole closure-context like in your block and returning \&do_something
updatelike:
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|