Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://357997]
help
Chatterbox?
[chacham]: How many man-hours would you estimate you have invested in learning Perl? what an annoying poll
[chacham]: s/annoying/ugly

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2017-04-30 20:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (542 votes). Check out past polls.