use strict; use warnings; use Data::Dump; my @MyArrayOfArray = ( [ "hello", "day", "sun and fun" ], [ 2, "okay", "may" ], [ "hello", "day", "sun and fun" ], [ 2, "okay", "may" ], [ "hello", "sun and fun", "day" ], [ 2, "okay", "may" ], ); my (%hash, @AoA2); for (@MyArrayOfArray) { my $key = join '', @$_; push @AoA2, $_ unless exists $hash{ $key }; ++$hash{ $key }; } dd \@AoA2;