use IPC::System::Simple qw(run); my $exit_value1 = run("foo", @args); my $exit_value2 = run([0..5], "foo", @args); #### use IPC::System::ExitValue qw/exit_value exit_signal/; system( "foo", @args ); croak "foo stopped early" if exit_signal($?); my $exit_value = exit_value($?); #### use IPC::System::ExitValue qw/assert_exit/; system( "foo", @args ) and assert_exit( 0 .. 5 );