in reply to accessing data in hash
FYI - you have a hash containing an array of hashes.my ($item) = grep { $_->{ID} == 32 } @{ $hash->{data} }; # Assumes ID + is unique die "No item had ID 32" unless $item; # Now compare Item's state.. if ($item->{State} eq "Stopped"){ print "Oh - I did not expect this\n"; }
What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
-Larry Wall, 1992
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: MIS-PARENTED: PLEASE REAP: accessing data in hash
by AnomalousMonk (Archbishop) on Mar 29, 2014 at 20:33 UTC |