perl -Mstrict -Mwarnings -MData::Dumper -e 'my @array = ( { foo => 1 }, { }, { }, { foo => 2 } ); my @elements = grep { exists $_->{foo} } @array; print Dumper \@elements' $VAR1 = [ { 'foo' => 1 }, { 'foo' => 2 } ];
In reply to Re^3: Array of Hashes
by friedo
in thread Array of Hashes
by ramya2005
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |