> Having said that, I think Benjamin's suggestion of having an eval function > at the very start of the script before any lexicals of any description > have been declared, is a sensible idea. It will help protect us against > any future changes to the code that inadvertently create a closure. Okay, so I think I know why it continues to fail. my $evalcode = sprintf('package %s; sub { @_ = (); eval $expr; }',$root); This line depends upon the fact that the $expr is in scope when we do the eval. The naive: my $evalcode = sprintf('package %s; sub { @_ = (); eval %s; }',$root,$expr); with test code print("Test a is :".$safe->reval('$a=1;').":\n"); Throws errors: Can't modify eval "string" in scalar assignment at (eval 1) line 1, at EOF (in cleanup) Undefined subroutine &main:: called at /home/httpd/lib/perl/Safe.pm line 226. So I guess I am out of my depth. -- guy@albertelli.com LON-CAPA Developer 0-7-6-1-