Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^5: define a hash-value, using hash-ref and a list of keys

by LanX (Saint)
on Oct 30, 2014 at 10:44 UTC ( [id://1105605]=note: print w/replies, xml ) Need Help??


in reply to Re^4: define a hash-value, using hash-ref and a list of keys
in thread define a hash-value, using hash-ref and a list of keys

Your code won't work as expected, because of low precedence of unless . Either use parentheses or a ternary operator.

Better have a look at Re^2: define a hash-value, using hash-ref and a list of keys if Perl < 5.10 is an issue.

{} is an anonymous hash (-ref).

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

Log In?
Username:
Password:

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

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

    No recent polls found