Help for this page

Select Code to Download


  1. or download this
    while (<$in>)
    {
    ...
           last;  #no need to look anymore!
       }
    }
    
  2. or download this
    {   my %unique;
    
    ...
    use List::Util qw(any uniq);
    
    print $OUT sort uniq <$IN>;
    
  3. or download this
    my $prev = "";
    foreach (sort <$IN>)
    ...
       print unless $_ eq $prev;
       $prev = $_;
    }