in reply to Boolean (was Boolian) operators defy my understanding...
system doesn't return true/false. Please refer to the documentation. For example, if the command was launched successfully and the exit code of the child process is 0, system returns 0.
my $rv = system(...); if ($rv == -1) { die("Unable to launch child: $!\n"); } if ($rv & 127) { die(sprintf("Error executing child: Child died with signal %d, %s c +oredump\n", ($rv & 127), ($rv & 128) ? 'with' : 'without', )); } if ($rv >> 8) { die(sprintf("Error executing child: Child exited with value %d\n", ($rv >> 8) )); } print("Child ran successfully\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Boolean (was Boolian) operators defy my understanding...
by cgmd (Beadle) on Jun 21, 2007 at 17:03 UTC | |
by ikegami (Patriarch) on Jun 21, 2007 at 17:33 UTC |