in reply to comparing 2 files problem
open (F1, "<file1.txt"); open (F2, "<file2.txt"); my $file2; { local $/; $file2 = <F2>; } while (<F1>) { print "Line $. not found.", unless ($file2 =~ /^$_/m); } close (F1); close (F2);
This will put all the content of file2 in a simple scalar, and then check if the line occures by using a regex.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: comparing 2 files problem
by ww (Archbishop) on Sep 08, 2004 at 17:13 UTC |