Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Whats happening to my hash ref.

by Aragorn (Curate)
on Jun 01, 2004 at 11:22 UTC ( [id://357997]=note: print w/replies, xml ) Need Help??


in reply to Whats happening to my hash ref.

You get what you ask for, i.e. the array reference, which you have to dereference properly to get the elements of the array:
foreach $key (keys(%$vars)){ print "$key\n"; foreach $array_elem ({@$vars->{$key}}) { print "\t$array_elem\n"; } # You can also use something like this to get at the array # elements individually: # print $vars->{$key}->[0]; # first element }
Arjen

Log In?
Username:
Password:

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

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

    No recent polls found