Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Do and Die

by jhourcle (Prior)
on Aug 15, 2005 at 18:56 UTC ( [id://483946]=note: print w/replies, xml ) Need Help??


in reply to Do and Die

system returns the status of the command returned by wait. Typical unix commands and C functions return '0' on success (ie, there was no error)

See the following example:

$ perl -e '$var = system("true"); print "[$var]\n"' [0] $ perl -e '$var = system("false"); print "[$var]\n"' [256]

Update: oops... shift 8 places to get the status of the command. 'false' should have returned '1':

$ false; echo $? 1

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-19 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found