Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
No such thing as a small change
 
PerlMonks  

Re: Help required for CGI Script

by graff (Chancellor)
on Dec 27, 2012 at 17:41 UTC ( #1010557=note: print w/ replies, xml ) Need Help??


in reply to Help required for CGI Script
in thread CGI Script Working fine from my command prompt but Shows Internal server error when called through browser

When you run it via a browser, does your script return "Hello, World!" to the browser, and does the file "/tmp/ac.txt" contain what you expected? Do you see the word "HI"? What does that file contain (what is the expected output from "autostatus -J aa-test-bx-dly")?

Since you are using "fatalsToBrowser", are you seeing any error messages? What do they say?

Your code only tries to print the first line of "/tmp/ac.txt" to the browser, but if the output begins with a blank line, that's all your program will send to the browser.

If the autostatus output contains angle brackets, then your browser will be trying to interpret it as HTML tags, and will probably not display any of it (because the data can't be parsed that way). In order to see the "autostatus" output presented, you may have to print a <pre> tag before printing the command output, and then print a </pre> tag afterwards.


Comment on Re: Help required for CGI Script
Select or Download Code
Re^2: Help required for CGI Script
by Anonymous Monk on Dec 28, 2012 at 07:46 UTC
    The output expected is RUNNING or SUCCESS .. Also the file so created doesnt have any blank lines. Please guide me the solution. Thanks
      Also the output is

      Content-Type: text/html; charset=ISO-8859-1 Hello, world! HI TEST JOB aa-test-bx-dly

      The solution is that you debug your program using the advice and links already provided in reply to your several posts. If you're unable or unwilling to do so consider speaking to your manager or team leader explaining the situation. Consider the code you've actually written, what it does and what you're attempting to do. Your "expected output" does not occur within your program. http://learn.perl.org, tutorials.
        I hav gone through all the links but havenot got the Solution.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-04-16 04:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (413 votes), past polls