use AnyEvent; use AnyEvent::Util; use File::Spec; my ($stdout, $stderr) = ('', ''); # I think these need to be empty strings, not undefs my $pid; my $cv = AnyEvent::Util::run_cmd [ qw(xcopy /Y /S /E /I /F /R /K), $source, $dest ], '<' => File::Spec->devnull(), '>' => \$stdout, '2>' => \$stderr, '$$' => \$pid, # this line is optional, you may not need it. ; my $rc = $cv->recv();