Baphi has asked for the wisdom of the Perl Monks concerning the following question:
I am comparing all the lines in a file, the first compare always works but after that they all go false.. I cant think of what to do for the life of me. please help :+)
open (saved_system, "saved_system.txt"); open (current_system, "current_system.txt"); open (deleted_archeive, ">>deleted.txt"); while ($saved_system = <saved_system>) { chomp; while ($current_system = <current_system>){ chomp; if ($saved_system eq $current_system) { print " Files are equal\n" +;} elsif ($saved_system ne $current_system) {print " Files are not eq +ual\n";} } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: comparing lines in two files
by ikegami (Patriarch) on Jan 01, 2010 at 11:09 UTC | |
|
Re: comparing lines in two files
by bobr (Monk) on Jan 01, 2010 at 07:58 UTC | |
by ikegami (Patriarch) on Jan 01, 2010 at 11:16 UTC | |
by bobr (Monk) on Jan 01, 2010 at 12:22 UTC | |
by ikegami (Patriarch) on Jan 01, 2010 at 22:26 UTC | |
|
Re: comparing lines in two files
by biohisham (Priest) on Jan 01, 2010 at 11:15 UTC | |
|
Re: comparing lines in two files
by Anonymous Monk on Jan 01, 2010 at 07:04 UTC |