in reply to Re: calling a perl script within a perl script
in thread calling a perl script within a perl script
system("...") || die "Can't run ...: $!\n";
No, that's almost never what you would want because system(), unlike qx(), returns the exit status which is conventionally 0 on success.
It usually better to be explicit with your system() calls:
if (system( ... ) == 0) { # it succeeded. } else { # it failed. my $exit_val = $? >> 8; my $signal = $? & 127; my $coredump = $? & 128; }
I should note that some people much prefer to write that clause as if (0 == system( ... )) and will go into violent spasms if they see it written as above. Of course, they've probably fallen out of their chairs by now, so we don't have to worry about them too much.
-sauoq "My two cents aren't worth a dime.";
|
|---|