For lexical variables, you may be able to do something with Lexical::Persistence.
#!perl use warnings; use strict; use Lexical::Persistence; # Create a new dynamic closure. my $dc = Lexical::Persistence->new(); # Prime a variable with a value. $dc->set_context( _ => { '$cat' => "persistent" } ); # Call a function within it. $dc->call(\&function); exit; sub function { # $cat is already initialized. print "persistent cat is '", my($cat), "'\n"; }
In reply to Re^3: override keywords "my" and "our"
by rcaputo
in thread override keywords "my" and "our"
by jeremygwa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |