agronbach has asked for the wisdom of the Perl Monks concerning the following question:
Hello wise monks,
I come here seeking wisdom as to why backticks (I know, only use them if I have to) are not playing nicely with my script when it is run through the web. If I run my script through a terminal, it works beautifully, but when I try to run it remotely from a web server it barely does anything.
So the reason I am using backticks is I am automating testing of my script, and I want to know what the result of each run of my script is (what STDERR and STDOUT is generated). As far as I know, backticks are the best way to go about this (correct me if I am wrong though).
This is the code I am using to test my script:
`dashboard.pl --source $_ 1>&2`;Yes, the path is relative. This is because both the scripts are in the same directory. I have also tried giving the absolute path (/u/alexandg/web/dashboard.pl) and it also was to no avail. The "--source $_" is the argument I use to pass in the test case. I am 100% sure this is not the issue.
The trouble is when I run this same command from the web server, nothing is reported back to the script. Granted I am not checking the return of the backticks, because I want them to ALWAYS continue no matter what happens. If the script I am testing crashes, thats OK, just report it and move onto the next test case.
All of these cases are stored inside of a while loop, and I am iterating over <$FILE> for test cases.
The questions I have are why doesn't this work from the web server, and how can I get it to function from both the command line and from the web?
Thank you!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI and Backticks
by GrandFather (Saint) on Aug 29, 2011 at 22:20 UTC | |
by agronbach (Novice) on Aug 29, 2011 at 22:33 UTC | |
|
Re: CGI and Backticks
by NetWallah (Canon) on Aug 29, 2011 at 23:35 UTC | |
|
Re: CGI and Backticks
by Anonymous Monk on Aug 29, 2011 at 23:57 UTC | |
by agronbach (Novice) on Aug 30, 2011 at 00:38 UTC | |
by Anonymous Monk on Aug 30, 2011 at 01:39 UTC |