in reply to return status from system()
Checking $? should just work, if the program you called reports the exit status correctly. If what you call is a shell script or other program you wrote, check if it exits with the correct exit status.
For example this works for me
$ perl -we 'system "true"; print $?,$/;' 0 $ perl -we 'system "false"; print $?,$/;' 256
|
|---|