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 ( #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
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
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 contemplating the Monastery: (7)
As of 2015-08-01 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls