in reply to Can a sub generate a closure from within itself?

If I understand the OP correctly, you can add a scope to instantiator I believe you can get the desired effect e.g
{ my $both; sub inst { my $inner = shift; $both .= "xxx "; return sub { printf "both: %s\nmine: %s\n", $both, $inner; }; } } for( 1 .. 3 ) { my $n = inst("[$_]"); &$n; } __output__ both: xxx mine: [1] both: xxx xxx mine: [2] both: xxx xxx xxx mine: [3]
So with the additional scope both inst and the newly generated sub will refer to the same lexical variable ($both).
HTH

_________
broquaint