- or download this
# build a hash that contains only excluded IDs
my %exclude = map { ( $_->{id} => 1 ) } @AoH_one;
# now keep only those that are not excluded:
my @keepers = grep { not $exclude{ $_->{id} } } @AoH_all;
- or download this
@AoH_all = grep { not $exclude{ $_->{id} } } @AoH_all;
- or download this
# use liz's technique
foreach my $i ( reverse 0 .. $#AoH_all )
...
# whoops, bug here, see update...
}
}
- or download this
# adjust $i after replacement so it is reexamined:
for ( my $i = 0; $i < @AoH_all; ++$i )
...
++$i;
}
}