http://qs321.pair.com?node_id=389914


in reply to Why isn't there a "copy" function?

Because Unix does not have a copy function. Doing a file copy requires extra code, which is in File::Copy. This isn't too inconsistent since file moves across filesystems requires similar support, like with File::Copy::move.

A better question is why Unix does not have a copy function to copy files. The operating system can do a better job copying files than user code. It can be much more efficient with network file systems, knows more about file attributes, better optimize IO, and could implement copy-on-write behavior. A copy() that only worked within a filesystem would be similar to rename().