in reply to removing duplicates from an array of hashes
IMHO, kcott's grep (++) is the cleanest, and classic/canonical.perl -MData::Dumper -E 'my $r=[map { id=>$_ }, ("a".."c","b")]; say Dumper $r; my %h; $h{$r->[$_]{id}}++ and delete $r->[$_] for 0..$#$r; say Dumper $r'
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: removing duplicates from an array of hashes
by bigj (Monk) on Apr 17, 2014 at 06:41 UTC | |
by NetWallah (Canon) on Apr 17, 2014 at 15:15 UTC |