Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Accessing deeply burried arrays of hashes

by Trinary (Pilgrim)
on Jan 25, 2001 at 04:02 UTC ( [id://54160]=note: print w/replies, xml ) Need Help??


in reply to Accessing deeply burried arrays of hashes

$tophash{$value1}{$value2} = [$a, $b, $c, $d];
change this to:
$tophash->{$value1}{$value2} = [$a,$b,$c,$d];

This can be referenced with $tophash->{$value1}{$value2}[$index], however you'd like. Each value in $tophash->{$one}{$two} will be a reference to an array, in your print statement something like print $subsubkey->[0] would get you at $a

Enjoy

Trinary

Replies are listed 'Best First'.
Re: Re: Accessing deeply burried arrays of hashes
by merlyn (Sage) on Jan 25, 2001 at 04:07 UTC
    It makes very little difference here whether the top structure is a hash or a scalar containing a hashref. That's not where the problem was.

    -- Randal L. Schwartz, Perl hacker

Thanks!
by Mandor (Pilgrim) on Jan 25, 2001 at 04:24 UTC
    Thank you for all your answers, folks. They have helped me greatly.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-29 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found