use Capture::Tiny 'capture'; my ($stdout, $stderr, @result) = capture { system( 'perl', '/full/path/to/program.pl', '-option' ) }; print "STDOUT received: <<$stdout>>\n"; print "STDERR received: <<$stderr>>\n"; print "Return value of system call was: <<@result>>\n";