Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: How to get the exit status and the output of the command launched in perl

by sunshine_august (Scribe)
on May 26, 2009 at 10:31 UTC ( #766183=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    [larry@august-dev perl]$ curl --max-time 3 2>&1
    curl: (6) name lookup timed out
    [larry@august-dev perl]$ echo $?
  2. or download this
     use strict;
     my $result = `curl --max-time 3 2>&1`;
     print "exit status: $?\n";
     print "result:\n", $result, "\n";
  3. or download this
    [larry@august-dev perl]$ ./
    exit status: 1536
    curl: (6) name lookup timed out

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://766183]
[Corion]: Weird. this documentation says what you say.
[Corion]: I assume you are experiencing this with your packaged program. Maybe also include in the packaging list?
[james28909]: has anyone else run into this problem? i have tried searching but have not returned many results
[james28909]: ah, good idea.
[Corion]: What does print $PerlApp::VERSION output?

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2017-07-28 13:57 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (429 votes). Check out past polls.