use File::Copy::Recursive qw(dircopy); dircopy($from,$to) or "Move $from -> $to failed: $!";