Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Answer: How do I find unique Array in Array of Array?

by mohan123 (Novice)
on Jun 13, 2006 at 13:32 UTC ( #555038=categorized answer: print w/replies, xml ) Need Help??

Q&A > arrays > How do I find unique Array in Array of Arrays? - Answer contributed by mohan123

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;

Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2020-10-21 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (212 votes). Check out past polls.

    Notices?