develooper Front page | perl.perl5.porters | Postings from February 2003

Re: [perl #21321] local ${"FOO"} does not work

Thread Previous | Thread Next
From:
Enache Adrian
Date:
February 24, 2003 13:11
Subject:
Re: [perl #21321] local ${"FOO"} does not work
Message ID:
20030224205855.GA16625@ratsnest.hole
On Sun, Feb 23, 2003 at 12:03:27AM +0100, Rafael Garcia-Suarez wrote:
> The patch below solves this problem by moving this error message
> from compile-time to run-time, and allowing the construct
> C<local ${expression()}> as long as the expression() returns a
> string, and not a reference.

$ perl -le '$a=1; { $b="a"; local $$b = 4; $b = 5; ${"a"} = 2 } print ${"a"}'
1
(with your patch applied, of course)

If this is ok, why '$b=\$a; local $$b' isn't ?

Shouldn't 'local $symref' work only with constant strings, at least ?

I hope you don't mind my questions.

Regards

Adi

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About