Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: syntax error with map in list context

by Aristotle (Chancellor)
on Nov 20, 2005 at 17:52 UTC ( #510260=note: print w/ replies, xml ) Need Help??


in reply to syntax error with map in list context

There are two ways to unconfuse perl about whether you mean a block or an anonymous hash, depending on which one it is:

  1. +{ ... } is always considered an anonymous hash. The unary plus is generally used to explicitly signify that what follows is an expression.

  2. {; ... } is always considered a block.

You’ll find that if you write your code as map {; ... } ..., it works.

Makeshifts last the longest.


Comment on Re: syntax error with map in list context
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://510260]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2014-09-23 18:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (238 votes), past polls