in reply to printing array ref of hash refs
the following foreach block example extracts State value for a single ref :
so to use it on all your refs, you'll need to run this foreach loop on each one of your refs.my $ref = [ { 'State' => 'Maine', 'Town' => 'Portland' }, { 'State' => 'New Hampshire', 'Town' => 'Concord' } ]; foreach ( @{$ref} ) { print $_->{State}."\n"; }
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 |