Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: printing array ref of hash refs

by mickeyn (Priest)
on Oct 25, 2006 at 14:55 UTC ( #580588=note: print w/ replies, xml ) Need Help??


in reply to printing array ref of hash refs

well, what do you mean by "I have an array refs" ? how do you contain them ?

the following foreach block example extracts State value for a single ref :

my $ref = [ { 'State' => 'Maine', 'Town' => 'Portland' }, { 'State' => 'New Hampshire', 'Town' => 'Concord' } ]; foreach ( @{$ref} ) { print $_->{State}."\n"; }
so to use it on all your refs, you'll need to run this foreach loop on each one of your refs.

HTH.

Enjoy,
Mickey


Comment on Re: printing array ref of hash refs
Download Code
Re^2: printing array ref of hash refs
by Anonymous Monk on Oct 25, 2006 at 15:03 UTC
    Mickey, that did the trick...Thanks!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2014-12-19 14:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (83 votes), past polls