in reply to WIFEXITED when system returns none zero
In according to system: "The return value is the exit status of the program as returned by the wait call. To get the actual exit value, shift right by eight."
UPDATE: You may find autodie interesting.#!/usr/bin/perl use strict; use warnings; use POSIX qw/ WIFEXITED /; WIFEXITED( (system '/bin/true') >> 8 ) or die "true $!"; WIFEXITED( (system '/bin/false') >> 8 ) or die "false: $!";
#!/usr/bin/perl use strict; use warnings; use autodie qw/:all/; system '/bin/true'; system '/bin/false';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: WIFEXITED when system returns none zero
by neilwatson (Priest) on Aug 11, 2015 at 17:34 UTC |