Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: strange map behavior

by kyle (Abbot)
on Feb 25, 2008 at 17:32 UTC ( [id://670057]=note: print w/replies, xml ) Need Help??


in reply to strange map behavior

This looks like syntax error with map in list context. The documentation for map says "{ starts both hash references and blocks, so map { ... could be either the start of map BLOCK LIST or map EXPR, LIST." This syntax works as well as the one you discovered:

my %h = map { +"$_" => "$_" } @arr ;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-23 10:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found