I'm sure that this is a fairly simple question, but its still giving me fits. How do you share variables when using Safe? There isn't a lot of documentation on Safe.pm and I can't seem to figure this out. The following code *should* print 7 when its run. Instead it doesn't print anything.
use Safe; my $maxCounter = 7; my $testCode = 'return $maxCounter;'; my $container = new Safe; $container -> share('$maxCounter'); print $container->reval($testCode)."\n";
In reply to Safe and sharing variables by goehle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |