|Problems? Is your data what you think it is?|
Running a backticks command in a CGI scriptby Cody Fendant (Pilgrim)
|on Apr 14, 2013 at 01:52 UTC||Need Help??|
Cody Fendant has asked for the
wisdom of the Perl Monks concerning the following question:
I have a command foobar which runs just fine from the command line as a normal user.
When I run foobar it normally takes about 5 seconds, then returns "success".
I want to run the command in a CGI script and print the "success" text back to the browser.
If I put $result = `foobar` into my CGI script, it finishes instantly (no 5-second wait) and $result is empty.
How do I troubleshoot this? If the script couldn't find foobar in the path, I would at least get something like "unknown command" back, right?
So the command is silently failing, perhaps because of permissions, because it's running as the www username? What can I do to figure out what's happening and how to get it to work?