But then the code is not usable from a module, no?
I have used things like the following in the past:
sub exec_callback { my $code = shift; my $caller = caller; no strict 'refs'; no warnings 'once'; local(*{$caller."::a"}) = \my $a; local(*{$caller."::b"}) = \my $b; $a = {}; $b = 1; $code->(); }
Good Day,
Dean
In reply to Re^2: Need an $a and $b as in perl's sort routine
by duelafn
in thread Need an $a and $b as in perl's sort routine
by rational_icthus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |