in reply to Rebinding closures, possible?

A similar thing that you can do is just keep around the text of the code that went into the closure. Then you can create a new closure of it in any scope you'd like:
my $code = q{ # some generic sub my ($param1,$param2) = @_; do_stuff($param1); do_more_stuff($param2); return whatever_you_return_from($param1,$param2); }; # ... my $closure_to_this_scope = eval "sub {$code}"; # ... my $closure_to_this_other_scope = eval "sub {$code}";
That's the beauty of perl: eval gives you dynamic lexical scoping for free. Additionally, closures let you fix a dynamicaly lexically scoped entity to a static lexical scope, as you please! (That's exactly what I've done above.)
------------ :Wq Not an editor command: Wq