If file 2 is fairly small, I'd put that file into a hash:
my %file_data; open( my $fh, '<', "/path/to/file2" ) or die $!; while(<>) { chomp; $file_data{$_} = $.; } close $fh;
You can then go through file1 line-by-line and lookup the hash entry. The value will be the line number that entry is on.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
In reply to Re: comparing 2 files problem
by hardburn
in thread comparing 2 files problem
by mosh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |