use Capture::Tiny ':all'; my @cmd = ( 'C:\program files\myprog\space invaders.exe', 'parameter 1', 'parameter 2 with spaces' ); my ($stdout, $stderr, $exit) = capture { system @cmd }; print "The return status was $exit\n"; print "The output was $stdout\n";