uniq LIST Returns a new list by stripping duplicate values in LIST. The order of elements in the returned list is the same as in LIST. In scalar context, returns the number of unique elements in LIST.And as you know you can slurp the whole of the input-file at once by assigning directly to an array.my @x = uniq 1, 1, 2, 2, 3, 5, 3, 4; # returns 1 2 3 5 4 my $x = uniq 1, 1, 2, 2, 3, 5, 3, 4; # returns 5
use strict; use List::MoreUtils qw/uniq/; my @all_no_dup = uniq <DATA>; print @all_no_dup; __DATA__ 1 5 9 4 8 1 5 66 57 2 9
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
In reply to Re: Entry Integrity
by CountZero
in thread Entry Integrity
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |