is there an easy way to tell if @PEOPLE contains a person named "John" w/o looping over the array and extracting each hash then comparing. The following works, but seems long-winded to me:while (blah) { ## do something %person = ('fname => $fname, 'lname' => $lname); push @PEOPLE, \%person; }
easier way?foreach my $ppl (@PEOPLE) { my $fname = $ppl->{'fname'}; .... }
In reply to easy way to extract a hash from an array? by rmexico
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |