in reply to File::Copy or system

In a pure unix environment, is File::Copy::copy($a,$b) preferred to system('cp',$a,$b)?

If what you want is to copy several files to a directory probably not, i.e:

use File::Basename; use File::Copy; use Carp; open my $a, 'myfile.txt'; my ($f,$b,$c) = $fileparse("/home/me/my_dir/my_other_file.txt"); copy($a,$b) or croak; # Oops!