Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Unique rows in Array of array

by choroba (Canon)
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;
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Comment on Re: Unique rows in Array of array
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991430]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2015-10-10 20:13 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (258 votes), past polls