With $?, you have to be careful that, its value is not exactly what returned from sub process, but $? >> 8 is.
Try this out with those two pieces of code:
system("perl -w c.pl"); print $? >> 8, "\n"; #this gives you 10 print $?; #this gives you 2560
c.pl:
exit 10;
In reply to Re: Need to capture return code
by pg
in thread Need to capture return code
by James_Marcinek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |