Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Checking and verifying a unix command sent in Perl

by ikegami (Pope)
on Jul 19, 2009 at 05:47 UTC ( #781423=note: print w/replies, xml ) Need Help??

in reply to Checking and verifying a unix command sent in Perl

system already provides the child's exit code as its return value.

$ true $ echo $? 0 $ perl -le'print system("true") >> 8' 0 $ false $ echo $? 1 $ perl -le'print system("false") >> 8' 1

Echoing it and capturing it is a waste.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://781423]
[LanX]: hmm reviews have no vote button?
[1nickt]: I use many books for purposes other than that for which they were written: decoration, paperweight, coffee mug coaster on the good table ...
[LanX]: ah Vote button missing on Review threads

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2017-11-17 21:52 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (274 votes). Check out past polls.