in reply to Re: Optimize code | remove duplicates from AOA.
in thread Optimize code | remove duplicates from AOA.

Not entirely sure, but (just for completeness) is your grep version supposed to sub the $A with $_ to eliminate the for loop and replace it with the grep?

So final, quickest version:

my %uniq; my @new_AOA = grep { !( $uniq{$_->[1] . '-' . $_->[3]}++ ) } @AOA;