use System2; my ($out,$err) = system2("cmd", "/C", "dir"); print "OUT: $out ERR: $err";