in reply to Re^2: Is there a way to avoid copy function from overwriting old contents?
in thread Is there a way to avoid copy function from overwriting old contents?
Replace:
copy("tmp", "RESULT_LOG");
with:
open my $tmpIn, '<', "tmp" or die "Failed to open tmp: $!"; open my $log, '>>', or die "Failed to open RESULT_LOG: $!"; print {$log} <$tmpIn>; close $log; close $tmpIn;
Copy overwrites so that is not what you wanted.
Note: you should always use three parameter open and lexical file handles.
|
|---|