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';
In reply to Re: WIFEXITED when system returns none zero
by pme
in thread WIFEXITED when system returns none zero
by neilwatson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |