in reply to comparing lines in two files
use strict; use warnings;
Another advice is to use the three argument form of open and show the open modes your files are accessed under (input, output, appending, piping...),
A third advice with open is to provide for explanation/clues of errors that could ensue, like if the file couldn't be opened, didn't exist, didn't have access attributes and more importantly if system-errors where involved, these clues can be indicated from $!..open (FH, '<', "saved_system.txt");
to read the perlvar documentation for $! from the terminal prompt of your machine, "perldoc perlvar $!"open(FH, '<', 'saved_system.txt')or die("Couldn't open file, $!");
Update:ikegami posted a wholesome example while I was writing these ideas :)...
|
|---|