in reply to Need to capture return code
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need to capture return code
by James_Marcinek (Initiate) on Oct 11, 2004 at 19:59 UTC |