It sounds like you realy want to pass it a hash. Then just preload the hash with values that it should have access to.
my $function = sub {my $v = shift; print ">> $v->{var} <<\n" }; my $params = {var => 'exto'}; $function->($params);
In reply to Re^3: Making variables visible between calls.
by eric256
in thread Making variables visible between calls.
by ambs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |