8 use POSIX qw(WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG);
10 our @ISA = qw(Exporter);
11 our @EXPORT_OK = qw(check);
14 my ($prog, $status) = @_;
19 elsif ($status == -1) {
20 croak "$prog executable not found\n";
22 elsif (WIFEXITED($status) and WEXITSTATUS($status)) {
23 croak "$prog exited with status ".WEXITSTATUS($status)."\n";
25 elsif (WIFSIGNALED($status)) {
26 croak "$prog halted by external signal ".WTERMSIG($status)."\n";
29 croak "$prog suffered from a random pantwetting event";