Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Greetings monks,
I believe a co-worker has discovered a bug in the Perl interpreter or at least he's found an interesting way to misuse it.
$ perl -Mstrict -Mwarnings -e 'map{ "$_" => 1 } ();' syntax error at -e line 1, near "} (" $ perl -Mstrict -Mwarnings -e 'map{ $_ => 1 } ();' $ perl -Mstrict -Mwarnings -e 'my $z = "z"; map{ "$z$_" => 1 } ();' syntax error at -e line 1, near "} ("
In the above lines, the first is the reduction of the problem to its most basic form albeit in a useless manner. The second one works ok. The third is the "interesting" one in that it's something you might actually want to do but it fails.
Thanks in advance for any thoughts you might have.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Error with doublequotes in map
by eric256 (Parson) on Feb 12, 2007 at 18:28 UTC | |
by Fletch (Bishop) on Feb 12, 2007 at 18:32 UTC | |
by bart (Canon) on Feb 12, 2007 at 21:05 UTC | |
by mreece (Friar) on Feb 12, 2007 at 23:06 UTC | |
by bennymack (Pilgrim) on Feb 12, 2007 at 18:33 UTC | |
by diotalevi (Canon) on Feb 12, 2007 at 18:40 UTC | |
by GrandFather (Saint) on Feb 12, 2007 at 20:19 UTC |