in reply to Re: Finding duplicate keys
in thread Finding duplicate keys
my @array1 = sort <$file1>; my @array2 = sort <$file2>; my ($l,$r) = (0) x 2; while ($l < @array1 and $r < @array2) { if(my $b = $array1[$l] cmp $array2[$r]) { ++($b == 1 ? $r : $l); } else { print "Dupe: $array1[$l]\n"; ++$l; ++$r; } }
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^2: Finding duplicate keys
by antirice (Priest) on Apr 06, 2003 at 01:12 UTC |