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
In reply to Re: accessing data in hash
by NetWallah
in thread accessing data in hash
by ccfc1986
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |