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

Re: Obtaining a return code

by bdimych (Monk)
on Dec 10, 2007 at 15:25 UTC ( #656141=note: print w/replies, xml ) Need Help??


in reply to Obtaining a return code

From perldoc -f system:
You can check all the failure possibilities by inspecting $? like this:

   if ($? == -1) {
       print "failed to execute: $!\n";
   }
   elsif ($? & 127) {
       printf "child died with signal %d, %s coredump\n",
           ($? & 127),  ($? & 128) ? 'with' : 'without';
   }
   else {
       printf "child exited with value %d\n", $? >> 8;
   }

See also: $?

and

POSIX system

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2019-11-17 02:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (85 votes). Check out past polls.

    Notices?