in reply to Piping into system commands

Any command that takes STDIN will work for piping into. cp is not one of those. I would read the man page for any command that you'll want to call directly from a Perl program. There are slight differences between platforms that can cause problems if you depend on them. You shouldn't be calling programs that you don't know the behaviour of.

One of the Perl ways of doing this without decent error checking. It works, but I see some changes need to be made before I'd allow it on my system.
use strict; use warnings; use File::Copy; my $file1 = shift || die "No args!\n"; my $file2 = shift || die "Second file please?\n"; copy("$file1","$file2");
I still recommend more manual reading