in reply to Pattern not manipulating file output
Open a tempory file, say "$file.tmp", write to that and then rename it to $file
Put
at the start of the scriptuse strict; use warnings;
Check you open the file handle
open IN, $file or die "Can't open $file: $!\n";
|
|---|