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


in reply to How do I find unique Array in Array of Arrays?

There's a likely cheaper solution to stringify an array of strings (no nested arrays) than using Data::Dumper: if you first quotemeta every string and then join by any \W character (except '\'), then you can uniquely recognize any combination of characters in the arrays, because the join string will not have a prepending backslash, and every \W character in the data will.

In addition, I'm using fewer extra data structures than in the other proposed solutions.

my %seen; my @aoa = grep { not $seen{join " ", map quotemeta, @$_}++ } @AoA;