in reply to clobbering files with File::Copy

You can use stat to get the original files mode and the after you overwrite the file you can do chmod to set the "new file's" mode to what the originals was.

Note: also check out sprintf and oct

Update:
You might also check out umask. This will change the mode for all files your process creates. You can set it to what ever mode you'd like but, it won't maintain the original files mode.

HTH

Sweetblood