ilottl has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w #use strict; $file1= "StatusRegs.txt"; $file2 = "RegsUNQ.txt"; open (ONE, $file1) or die "Couldn't open $file1: $!\n"; open (TWO, $file2) or die "Couldn't open $file2: $!\n"; while ($line1 = <ONE>) { $line2 = <TWO>; if ($line1 ne $line2) { print "$line1 does not equal $line2 at line $.\n"; } else { print "$line1 is the same in both files at line $.\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comparing 2 files without diff or compare
by Zaxo (Archbishop) on May 02, 2007 at 01:49 UTC | |
|
Re: Comparing 2 files without diff or compare
by merlyn (Sage) on May 02, 2007 at 06:59 UTC | |
by akho (Hermit) on May 02, 2007 at 08:29 UTC | |
|
Re: Comparing 2 files without diff or compare
by ilottl (Novice) on May 02, 2007 at 02:12 UTC | |
by GrandFather (Saint) on May 02, 2007 at 02:22 UTC | |
by ilottl (Novice) on May 02, 2007 at 06:48 UTC |