Help for this page

Select Code to Download


  1. or download this
    my $last;
    my $i = 0;
    ...
       $last = $_;
       print OUT ("$_ $i\n");
    }
    
  2. or download this
    perl -lpe "$i++ if ($_ ne $last); $last = $_; $_.=' '.$i;" inputfile >
    + outputfile