use Data::Dumper; my @AoA = (['a','b','c'], ['a','b','c'], ['a','b','d'], ['a','b','d']); my @uAoA = uniq(@AoA); sub uniq () { #updated, the prototype was taken out my %h; map { $h{$_}++ == 0 ? $_ : () } @_; print Dumper \%h; }