in reply to Do and Die
system returns the status of the command returned by wait. Typical unix commands and C functions return '0' on success (ie, there was no error)
See the following example:
$ perl -e '$var = system("true"); print "[$var]\n"' [0] $ perl -e '$var = system("false"); print "[$var]\n"' [256]
Update: oops... shift 8 places to get the status of the command. 'false' should have returned '1':
$ false; echo $? 1
|
|---|