Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Process exit status

by Dirk80 (Pilgrim)
on Jul 22, 2011 at 14:21 UTC ( [id://916147]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Process exit status
in thread Process exit status

To be honest. I did not understand the explanation in system. So I tried myself to understand it. This lead me to a sample program in which I then finally used the division by 256, although you are right that it is clearly stated in the docs that a 8bits shift to the right has to be done to get the exit code.

Now I understand the explanation well. The example at the end with $? also shows that the signal id is the other part of the exit status.

My problem was that the explanation did not state explicitly that the return value of "system" is 16 bits, and that the lower 7 bits are the signal id which caused the process to die. With this bit representation in my mind I would not have needed to ask you.

Thank you for your help. And next time I will ask clearer what I exactly want to know and what part of the docs I don't understand.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://916147]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-23 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found