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 ☆☆☆☆ :)