use File::Copy; copy("file1","file2") or die "Copy failed: $!"; $n = FileHandle->new("/a/file","r"); copy($n,\*STDOUT);