Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: strange syntax error with map

by BillKSmith (Monsignor)
on Apr 09, 2017 at 13:30 UTC ( [id://1187523]=note: print w/replies, xml ) Need Help??


in reply to Re: strange syntax error with map
in thread strange syntax error with map

I recently had a similar problem which I solved by changing to the EXPR,LIST form of map. Thanks for the explanation.
C:\Users\Bill>perl -wMstrict -le "print map( do{2,$_}, 1..2)" 2122
Bill

Replies are listed 'Best First'.
Re^3: strange syntax error with map
by ikegami (Patriarch) on Apr 10, 2017 at 16:00 UTC
    Far simpler way to disambiguate:
    {; ... } # BLOCK +{ ... } # Hash constructor
      Your solution requires an understanding of the problem. That is exactly what I was thanking haukex for. Note that I bypassed the problem rather than fix it.
      Bill
Re^3: strange syntax error with map
by rsFalse (Chaplain) on Apr 12, 2017 at 23:32 UTC
    Nice idea to use 'do{ }' sentence, I like to use it. So I'll use 'do{ }' in such situations.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-25 08:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found