go ahead... be a heretic | |
PerlMonks |
strange map behaviorby jeanluca (Deacon) |
on Feb 25, 2008 at 17:18 UTC ( [id://670051]=perlquestion: print w/replies, xml ) | Need Help?? |
jeanluca has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks Most of the time map surprises me, it always generates output I don't expect. This time however it goes beyond this. Here is my test code: Which returns However when I change the map-line into: my %h = map { $_."" => "$_" } @arr ; it works and produces
This is truly map magic for me! Anyone out there who has already walked this path ? CHeers LuCa Update: thnx monks, I appreciate the help!!
Back to
Seekers of Perl Wisdom
|
|