in reply to Duplicate and rename file?

Just have a look at File::Copy.