#!/usr/bin/perl # # usage: perl removeduplines.pl infile outfile # # removes any lines that are exactly like the previous line my $infile = $ARGV[0]; my $outfile = $ARGV[1]; open (IN,$infile); open (OUT,">$outfile"); my $x = ""; my $lastx = "blah"; while ($x = ) { $x = ; if ($x ne $lastx) { print OUT $x; } $lastx = $x; }