in reply to compare an array of hashes
If your data is key driven then you can use a hash to find the unique keys and then grep them from the list.
my @wanted; my %keys; $keys{$_->{flag}}++ foreach (@array1, @array2); my @unique = grep {$keys{$_->{flag}} == 1} @array2; print Dumper(@unique);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: compare an array of hashes
by Anonymous Monk on Mar 10, 2006 at 13:42 UTC |