in reply to Re: Re: writing to top of a file
in thread writing to top of a file
rename $fname, $file1;use File::Temp qw/tempfile/; use File::Copy; my ($fh, $fname) = tempfile(); syswrite $fh, "FIRST LINE\n"; copy($file1, $fh) or die "Error copying: $!"; close $fh;
|
|---|