On Thu, Sep 18, 2003 at 07:53:39PM -0000, Rafael Garcia-Suarez <[EMAIL PROTECTED]> 
wrote:
> Yitzchak Scott-Thoennes wrote in perl.fwp :
> >> 
> >>   sub getaglob {*foo}
> >>   $foo = "pong\n";
> >>   { local ${&getaglob} = "ping "; print $foo }
> >>   print $foo;
> >> 
> >> fails with "Can't localize through a reference"!
> > 
> > This error seems to be removed in 5.8.1 and it works there (though the
> > error entry was erroneously left in perldiag).
> 
> perldiag is still correct, because this error was only removed in some
> cases.  Perl 5.8.1 allows localization through a symbolic reference, but
> not a hard one :
> 
>     $ bleadperl -le '$x="a";local $$x=2;print$a,$$x'
>     22
> 
>     $ bleadperl -le '$x=\"a";local $$x=2;print$$x'
>     Can't localize through a reference at -e line 1.

Sorry for casting aspersions while leaping to conclusions...I grepped
*.c and saw it there for 5.6.2 but not 5.8.1.  I forgot to check *.h.

So is it unintentional that you can localize through an expression
resulting in a glob?

Reply via email to