Help for this page

Select Code to Download


  1. or download this
    my @comp = "seed\n";                                # Fix 1 
    while ($line = <>) {
    ...
       print $line if $comp[0] =~ /^\Q$comp[1]\E\z/;    # Fix 2
       shift(@comp);
    }
    
  2. or download this
    my @comp = "seed\n"; 
    while ($line = <>) {
    ...
       print $line if $comp[0] eq $comp[1];
       shift(@comp);
    }
    
  3. or download this
    my $last = ""; 
    while (<>) {
       print if $_ eq $last;
       $last = $_;
    }