Steve Bertrand wrote:
> I got it...
> 
> for my $item (@clean) {
>         if (! grep ($_ eq $item, @array)) {
>                 push (@array, $item);
>                 print "$item\n";
>         }
> }

FWIW, this is a FAQ (see "perldoc -q duplicate"). If the array elements can
be compared with string semantics (as you are doing here), the following
will work:

   my @array = do { my %seen; grep !$seen{$_}++, @clean };

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to