in reply to Re: Variable name missing in warning
in thread Variable name missing in warning
> perl -MO=Deparse,-q use warnings; my (%a, %b, $c); my $x = "$a{'foo'} $b{'bar'} $c" __END__ use warnings; my(%a, %b, $c); my $x = $a{'foo'} . ' ' . $b{'bar'} . ' ' . $c; - syntax OK
-q reveals the mentioned optimization of string-interpolations, but the variable name is not affected.
I thought this is only a negligible bug, such that after fixing $a{foo} the following $b{bar} would be visible, but that's unfortunately not the case:
> perl -w my (%a, %b, $c); $a{foo}="FIXED"; my $x = "$a{'foo'} $b{'bar'} $c"; __END__ Use of uninitialized value in concatenation (.) or string at - line 3. Use of uninitialized value $c in concatenation (.) or string at - line + 3.
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Variable name missing in warning (source)
by tye (Sage) on Apr 03, 2014 at 06:24 UTC | |
by LanX (Saint) on Apr 03, 2014 at 10:02 UTC | |
by tye (Sage) on Apr 03, 2014 at 20:59 UTC | |
by LanX (Saint) on Apr 03, 2014 at 21:14 UTC |