in reply to Re^2: Making variables visible between calls.
in thread Making variables visible between calls.
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);
|
|---|