in reply to Mysterious "syntax error"
Because map can take either a block or an expression, and open curly can start a block or an expression (start of an anonymous hash), there's some "guessing" code to deal with the ambiguity, and sometimes it guesses wrong.
You can disambiguate these with:
This is documented in perldata I believe. Or perlref.map {; ... definitely a block ... } ... map +{ ... definitely an anonhash ... }, ...
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Mysterious "syntax error"
by BrowserUk (Patriarch) on Nov 30, 2004 at 16:07 UTC | |
Re^2: Mysterious "syntax error"
by dragonchild (Archbishop) on Nov 30, 2004 at 18:12 UTC | |
by BrowserUk (Patriarch) on Nov 30, 2004 at 22:48 UTC | |
by tye (Sage) on Dec 01, 2004 at 00:20 UTC | |
by BrowserUk (Patriarch) on Dec 01, 2004 at 01:22 UTC | |
by merlyn (Sage) on Nov 30, 2004 at 22:10 UTC |
In Section
Seekers of Perl Wisdom