How to test the exit status from IPC::Run3
问题 I'm trying to test the Perl module IPC::Run3 but having difficulty in checking whether a command is failed or successful. I know that IPC::Run3 issues an exit code if something is wrong with its arguments, but what about if the arguments are ok but the command does not exist? How can I test the following example? Having a subroutine to call Run3 sub runRun3 { my $cmd = shift; my ($stdout, $stderr); run3($cmd, \undef, \$stdout, \$stderr); # if( $? == -1 ) { if (! $stdout and ! $stderr) { die