Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Not understanding the arrow operator

by John M. Dlugosz (Monsignor)
on May 18, 2009 at 19:59 UTC ( [id://764716]=note: print w/replies, xml ) Need Help??


in reply to Not understanding the arrow operator

Update: Sorry, I addressed the wrong point. I thought I read "fat arrow". But my note on not needing the quotes still holds.

The fat arrow is the same as comma. It has the side effect of letting you not quote the left side. So

'level' , '1','id' , 4
should be exactly the same as
'level' , '1','id' , 4
as the hash constructor syntax (putting stuff between braces) just wants a list with an even number of elements, taken as alternating keys and values. That's why it works for parameter lists too.

You could actually write

level => '1', id => 4
and be even less noisy.

—John

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-03-28 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found