in reply to overwrite a file
sub copy( source, destination ) { open SOURCEFILE "source"; open DESTINATIONFILE "destination"; while (<SOURCEFILE>) { print DESTINATIONFILE ; } close DESTINATIONFILE; close SOURCEFILE; }
If so, then maybe the problem is in how you're opening the destination file.
to read a fileopen FILE "<$file";
to write to a file, creating it if necessaryopen FILE ">$file";
to append to a file, creating it if necessaryopen FILE ">>$file";
Forget that fear of gravity,
Get a little savagery in your life.
|
|---|