in reply to Re^3: Is there better way to delete dups in an AoH?
in thread Is there better way to delete dups in an AoH?
I doesn't work exactly the way it should and returns:use Data::Dumper; use strict; my $AoH = [ { page => 'spring', chap => 'spring'}, { page => 'winter', chap => 'winter'}, { page => 'fall', chap => 'fall'}, { page => 'summer', chap => 'summer'}, { page => 'spring', chap => 'spring'} ]; my %uniq = map { $_->{page} => ; $_->{chap} => 1 } @$AoH; @$AoH = map { { page => $_ };{ chap=>$_ } } keys %uniq; print Dumper ($AoH);
$VAR1 = [ { 'chap' => 'summer' }, { 'chap' => 'winter' }, { 'chap' => 'fall' }, { 'chap' => 'spring' } ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Is there better way to delete dups in an AoH?
by Roy Johnson (Monsignor) on Jun 06, 2004 at 23:30 UTC | |
by bradcathey (Prior) on Jun 06, 2004 at 23:53 UTC | |
by bradcathey (Prior) on Jun 08, 2004 at 02:37 UTC | |
by Roy Johnson (Monsignor) on Jun 08, 2004 at 03:32 UTC | |
by bradcathey (Prior) on Jun 08, 2004 at 11:03 UTC | |
|
Re^5: Is there better way to delete dups in an AoH?
by qq (Hermit) on Jun 07, 2004 at 00:01 UTC | |
by hv (Prior) on Jun 07, 2004 at 01:31 UTC | |
by qq (Hermit) on Jun 08, 2004 at 00:18 UTC |