This is the code I have which is currently not working, i'm getting 'File cannot be copied. at copy line 8.' which is the last line of code.
use File::Copy;
$file = "C:\Users\xps\Documents\test.";
$newfile = "C:\Users\xps\Documents\test2.";
copy ($file, $newfile) or die "File cannot be copied.";