Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Accessing a Hash of Hashes

by c-era (Curate)
on Nov 17, 2001 at 01:18 UTC ( #125919=note: print w/ replies, xml ) Need Help??

in reply to Accessing a Hash of Hashes

Your problem is how you copy the data from $VAR1 to %Status. This code works for me:

$VAR1 = { '1' => { '1' => { 'EMail' => '', 'Name' => 'Norbert Bodkin' }, '5' => { 'EMail' => '', 'Name' => 'Sue Soup' } }, '2' => { '3' => { 'EMail' => '', 'Name' => 'Max Grappler' } } }; my %Status = %$VAR1; my $status; for $status (keys %Status) { for (keys %{ $Status{$status} }) { print $Status{$status}{$_}{'Name'}, br; } }
The error message tells you, that instead of a hashref you have a value. If you post the code that copies $VAR1 to %Status, I would be able to help you further.

Also, hashes don't have order. So, if you want to do a sort on keys, you'll need to create a sorted array with those keys.

Comment on Re: Accessing a Hash of Hashes
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2015-11-30 09:50 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (769 votes), past polls