Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Re: system call not working

by borisz (Canon)
on May 13, 2004 at 08:30 UTC ( [id://353009] : note . print w/replies, xml ) Need Help??


in reply to Re: Re: system call not working
in thread system call not working

Hi,
But the "or die" part is wrong: system() will return the exit status of the process, which is based on shell semantics: a return value of zero means "success" (i.e. "good") whereas any non-zero value means "failure" (i.e. "bad") -- so you probably want to say "and die" instead.
You are wrong, the example is fine.
system('procheck', $pdbfile, '1.0') == 0 or die "system failed ( $? )" +;
die is only called, if the returncode from system is not 0. This is exactly what we want it to do.
Boris