Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Is "die" the best way to be atomic?

by mce (Curate)
on Apr 27, 2004 at 10:10 UTC ( #348427=note: print w/ replies, xml ) Need Help??


in reply to Is "die" the best way to be atomic?

Hi,

You also could rely on the calling shell to do it for you.

$rc=system(<<EOF); set -e ls this_command_does_not_exist EOF die if $rc;
But this solution fits more in the ShellMonks :-)

PS: I don't know why, but $? is not set!!


---------------------------
Dr. Mark Ceulemans
Senior Consultant
BMC, Belgium


Comment on Re: Is "die" the best way to be atomic?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (12)
As of 2015-07-28 10:02 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 (254 votes), past polls