in reply to What is the best way to move a directory to a mounted filesystem?

File::Copy can rename directories, but it can't copy them, so it can't be used to move one to another filesystem.

It's probably simpler to use system to execute a tool provided by your OS.

By the way, no need to put your variables in double quotes.

Update: How about:

my $cp_rv = system('cp', '-rp', $src, $dst); if ($cp_rv) { if ($cp_rv == -1) { die("Unable to launch 'cp': $!\n"); } else { system('rm', '-rf', $dst); die("Unable to copy \"$src\" directory. \"cp\" returned $?\n"); } } system('rm', '-rf', $src);