Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: I don't understand hash references

by LanX (Saint)
on Dec 07, 2009 at 15:28 UTC ( [id://811517]=note: print w/replies, xml ) Need Help??


in reply to I don't understand hash references

$k3 = %{$hashr->{ $k1 }->{ $k2 }};

is analogues to

$k=%hash

$k3 is not a hashref but the scalar-value of a hash (... which produces something mostly useless like 1/8 indicating the memory use)

what you really want is either

$k3 = $hashr->{ $k1 }->{ $k2 };

to get the hashref

or

%h3 = %{$hashr->{ $k1 }->{ $k2 }};

to copy the nested sub-hash!

Cheers Rolf

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2024-03-28 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found