Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Best method to capture return code from system calls?

by davidrw (Prior)
on Aug 24, 2005 at 14:49 UTC ( #486214=note: print w/ replies, xml ) Need Help??


in reply to Best method to capture return code from system calls?

regarding the return code from system, here's a perldoc -f system snippet:

               The return value is the exit status of the program
               as returned by the "wait" call.  To get the actual
               exit value divide by 256. 
    -- snip --
               You can check all the failure possibilities by
               inspecting "$?" like this:

                   $exit_value  = $? >> 8;
                   $signal_num  = $? & 127;
                   $dumped_core = $? & 128;
See also the $? section in perldoc perlvar. In brief, it is The status returned by the last pipe close, backtick ("``") command, successful call to wait() or waitpid(), or from the system() operator.


Comment on Re: Best method to capture return code from system calls?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (22)
As of 2015-07-28 19:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls