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

Re: Hash element access -dereferenced hashes

by choroba (Canon)
on Dec 06, 2012 at 10:10 UTC ( #1007507=note: print w/ replies, xml ) Need Help??


in reply to Hash element access -dereferenced hashes

Works for me. Note I use key1 as a string, not the undefined variable $key1. Use strict and warnings to catch this kind of problems.

%hash1 = (key1 => "value1"); %hash2 = (value1 => "Gotcha"); print $hash2{ $hash1{key1} }, "\n"; # Not $key1!
Output:
Gotcha
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Hash element access -dereferenced hashes
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (12)
As of 2015-07-08 03:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls