Rafael Garcia-Suarez | 1 Mar 2010 09:33
Gravatar

Re: Global variables not initialized in Safe

On 1 March 2010 03:36, Tim Bunce <Tim.Bunce <at> pobox.com> wrote:
> This doesn't seem reasonable to me:
>
> $ perl -MSafe -we 'warn Safe->new->reval(q{ my  <at> a=(1..5); " <at> a" })'
> Use of uninitialized value $" in join or string at (eval 5) line 1.
> 12345 at -e line 1.
>
> Sharing variables like $" isn't appropriate because it wouldn't be safe.
> But initializing them to either their default value, or the current
> value when Safe->new is called, seems reasonable.
>
> Thoughts?

The default value seems more reasonable to be, given the context --
executing untrusted, external code.


Gmane