in reply to comparing 2 files problem

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.