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

Re: Running a backticks command in a CGI script

by NetWallah (Canon)
on Apr 14, 2013 at 05:18 UTC ( [id://1028597]=note: print w/replies, xml ) Need Help??


in reply to Running a backticks command in a CGI script

Try capturing STDERR in addtion to the STDOUT output:
$result = `foobar 2>&1`
You should also check the value of "$?". From the docs:
$? may be set to non-0 value if the external program fails. The upper eight bits reflect specific error conditions encountered by the program (the program's "exit()" value).

             "I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
        -- Dr. Cox, Scrubs

Replies are listed 'Best First'.
Re^2: Running a backticks command in a CGI script
by Cody Fendant (Hermit) on Apr 14, 2013 at 08:47 UTC
    That's done the trick, thank you. I have a full, detailed and ... incomprehensible error message now. But that's cool, I've solved the immediate problem.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-23 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found