Pathologically Eclectic Rubbish Lister | |
PerlMonks |
(5.6.1) map mayhem?by jynx (Priest) |
on Oct 07, 2003 at 19:43 UTC ( [id://297370]=perlquestion: print w/replies, xml ) | Need Help?? |
jynx has asked for the wisdom of the Perl Monks concerning the following question: In Perl 5.6.1, writing out a little test script i got my error to one little line. Here's the entire script to start with:
When compiling that as is Perl bails on a syntax error. The second (more ugly) version works fine, as well as using a variable instead of a hard-coded string. That's fine and good, but why is it happening that way? i would think one would be able to code as i have above, but (on a Solaris 9 machine running the standard Perl 5.6.1 Sun install) apparently not. If i add parentheses i find out that apparently Perl is viewing { anda => $_ } as a hash reference, but map is expecting a code reference, so that's probably where the discrepency comes from. Questions:
jynx
Back to
Seekers of Perl Wisdom
|
|