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"; } }
In reply to Re: Binary Search
by borisz
in thread Binary Search
by dave_pl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |