while (1) { ... } #### my @a; while (my $val = <>) { chomp $val; push @a, $_ if !grep $_ eq $val, @a; } #### my @a; my %seen; while (<>) { chomp; next if $seen{$_}++; push @a, $_; }
## my @a; while (my $val = <>) { chomp $val; push @a, $_ if !grep $_ eq $val, @a; } ##
## my @a; my %seen; while (<>) { chomp; next if $seen{$_}++; push @a, $_; }