use strict; my %guard; my @unique; while (<>) { chomp; push @unique,$_ if (!exists $guard{$_}); $guard{$_} = 1; } print join(" ",@unique),"\n";
In reply to Re: unique elements in an array
by tall_man
in thread unique elements in an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |