in reply to Is there a way to avoid copy function from overwriting old contents?
Or:use autodie; use File::Copy 'copy'; my $append = ...; # If true append, else overwrite. open my $fh, $append ? ">>" : ">", LOG; copy "tmp", $fh;
my $append = ...; # If true append, else overwrite. system "cat tmp " . ($append ? ">>" : ">") . " LOG" and die;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is there a way to avoid copy function from overwriting old contents?
by justkar4u (Novice) on Apr 12, 2011 at 17:45 UTC |