http://qs321.pair.com?node_id=489796

monkfan has asked for the wisdom of the Perl Monks concerning the following question: (arrays)

Given this:
my @AoA = ( ['a','b','c'], ['a','b','c'], ['a','b','d'], ['a','b','d'], );
I wish to return simply this:
my @uAoA = ( ['a','b','c'], ['a','b','d'], );
From the original posting in SoPW, one can find many answers. One of them is (by TedPride), seems to me to be the most compact of them all:
use strict; use warnings; use Data::Dumper; my @AoA = ( ['a','b','c'], ['a','b','c'], ['a','b','d'], ['a','b','d'], ); my (%h, @uAoA); for (@AoA) { push @uAoA, $_ if !$h{join $;, @$_}++; } print Dumper \@uAoA;

Originally posted as a Categorized Question.