use strict; use warnings; use Data::Dumper; my @AoA = (['a','b','c'], ['a','b','c'], ['a','b','d'], ['a','b','d']); my %temp=(); my @aoa=map{[split $;,$_]}grep{++$temp{$_}<2} map {join $;,@$_} @AoA; print Dumper \@aoa;