P is for Practical | |
PerlMonks |
Re^5: define a hash-value, using hash-ref and a list of keysby LanX (Saint) |
on Oct 30, 2014 at 10:44 UTC ( [id://1105605]=note: print w/replies, xml ) | Need Help?? |
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 ☆☆☆☆ :)
In Section
Seekers of Perl Wisdom
|
|