#!/usr/bin/perl $filea = $ARGV[0]; $fileb = $ARGV[1]; open(A, $filea); open(B, $fileb); $time_now = time(); open(OLD, ">del.csv"); open(NEW, ">add.csv"); while (!($eof_a && $eof_b)) { $i++; unless ($a = ) { $eof_a = 1; } chomp($a); unless ($b = ) { $eof_b = 1; } chomp($b); while (($a ne $b) && (!$eof_a) && (!$eof_b)) { if ($a lt $b) { print OLD $a."\n"; unless ($a = ) { $eof_a = 1; } chomp($a); } if ($a gt $b) { print NEW $b."\n"; unless ($b = ) { $eof_b = 1; } chomp($b); } } if (time() > $time_now) { $time_now = time(); print $i."\n"; $i = 0; } } close(OLD); close(NEW);