in reply to Closure Over Scalar?

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

update

like:

sub generate { my $FIXED_STRING = 'fixed_string'; my %persistent; return sub { ... }

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery