You're not checking the return values of both of your file opens.
Thanks, I shouldn't have missed that
Thanks also for pointing out that I could use File::Copy, I certainly need practise getting into the mode of thinking "is there a module that could do this?"