Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Unique rows in Array of array

by choroba (Bishop)
on Sep 03, 2012 at 13:05 UTC ( #991430=note: print w/replies, xml ) Need Help??


in reply to Unique rows in Array of array

To filter an array one usually uses grep. You have to dereference the inner arrays to get to their members:
#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my @array = ([ 1, 2, 3], [10, 10, 10], [ 1, 1, 5]); my @nonequal = grep $_->[0] != $_->[1] || $_->[2] != $_->[0], @array; print Dumper \@nonequal;
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991430]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2018-01-20 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (227 votes). Check out past polls.

    Notices?