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 20, 2003 14:51
Subject:
Re: [perl #21321] local ${"FOO"} does not work
Message ID:
20030220225131.GA1408@ratsnest.hole
On Thu, Feb 20, 2003 at 07:28:47PM -0000, Jarkko Hietaniemi wrote:
> But I still fail to see a reference in there.  To be honest, I had
> originally something more that "FOO" in between the {}, I had "\cFOO".
> But still completely compiletime, nothing naughty like "FOO$BAR".

${"FOO"} a symbolic reference, and that's at compile-time that perl barfs.
(in Perl_mod() - op.c)

BTW ( of symbolic refs) , I stumbled on this when fixing the
braces & interpolation problem:

$ perl -le 'my $b=1; $a = "b"; print $$a'
$

leaving the 'my' out gets the expected behaviour.

I rarely used symbolic references in Perl - Is this a bug or a feature ?

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