in reply to Binary Search
my %h; open my $fh, "<file1" or die $!; while ( defined( $_ = <$fh> ) ) { $h{$_} = $.; } open my $fh2, "<file2" or die $!; while ( defined( $_ = <$fh2> ) ) { if ( exists $h{$_} ) { print "line $. is a dup of line $h{$_}\n"; } }
|
---|