in reply to Finding Redundant values in arrays
If you're not familiar with grep you can read all about it in perldoc -f grep but as I understand it, it returns a list consisting only of the elements in @test for which the block or expression return true. So for this snippet the block { ++$seen{$_} == 2} only returns true the second time the element has been seen.%seen = (); @unique = grep { ++$seen{$_} == 2} @test;
Hope this helps
Ira
"So... What do all these little arrows mean?"
~unknown
|
|---|