I need to copy read-only files in Perl. I tried using Perl::Copy function, but it fails in case the file already exists and isn’t writable.
Is there a force argument I can give to the copy function?
I want to avoid changing permissions of files, or removing the destination file before copying.
Seems like you are giving yourself unreasonable requirements. I think the best solution is to remove the destination file before copying, which should be as simple as: