Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Whats happening to my hash ref.

by Aragorn (Curate)
on Jun 01, 2004 at 11:22 UTC ( #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


Comment on Re: Whats happening to my hash ref.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2014-08-01 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls