##
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 );