in reply to File::Copy dying on Win2k when target file already there
If you were to drop the "or die..." part, it wouldn't do that. It wouldn't replace the file that was there, either, so it's not the best of solutions.copy($localfile, $installfile) or die "unable to copy to $installfile\n";
$installfile looks like it contains an absolute path to me. You may try to delete a file without checking if it did indeed exist, like this:
No error checking here: if it fails, nothing happens. If you were to put this line just in front of the line containing the copy(), including the die() part, this would likely do the proper thing: replace an existing file, and die() if it fails.unlink $installfile;
|
|---|