Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: printing array ref of hash refs

by mickeyn (Priest)
on Oct 25, 2006 at 14:55 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://580588]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-03-19 11:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found