Don't ask to ask, just ask | |
PerlMonks |
Process exit statusby Dirk80 (Pilgrim) |
on Jul 22, 2011 at 11:15 UTC ( [id://916099]=perlquestion: print w/replies, xml ) | Need Help?? |
Dirk80 has asked for the wisdom of the Perl Monks concerning the following question: Hello wise monks, I want to check the process exit status of a child program (child.pl) from my parent program. (parent.pl) parent.pl:
child.pl:
The strange thing is that in the parent program the process exit code seems to be multiplicated with 256. So in this example the printed process exit code is 512 and not 2 as I would have expected. If I change the parent program as follows, then I get the desired result: parent_changed.pl:
My question is: Why is the process exit code, when I get in the parent program a multiple of 256 of the real process exit code of the child program? Thank you. Greetings, Dirk
Back to
Seekers of Perl Wisdom
|
|