Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Premature End of Script Headers

by dsb (Chaplain)
on Jul 28, 2004 at 20:54 UTC ( #378214=perlquestion: print w/ replies, xml ) Need Help??
dsb has asked for the wisdom of the Perl Monks concerning the following question:

I've gotten many CGI scripts to work before, but I am at a complete loss as to what is breaking this one. No matter what I do I get the premature end of script headers error. I've got only 2 print statements in my entire script:
  • print $q->header("text/html");
  • print $tmpl->output;

The only other place I can imagine the error being is in the template file I'm using for HTML::Template, but I can't spot anything there either.

Rather than muck up this post with all sorts of code, I've posted links to some text files:
UPDATE:

  • Problem solved - links to source code removed.
Before you ask, DSB.pm is just a package of some silly little functions i didn't feel like writing over and over again.

Soemthing that might be noteworthy: I didn't install Perl or any modules. This is a hosting company and they just recently installed HTML Template...Just thought I'd mention it.

Any insight is much appreciated. I'm going to dunk my head in the water barrel.


dsb
This @ISA my cool %SIG

Comment on Premature End of Script Headers
Re: Premature End of Script Headers
by diotalevi (Canon) on Jul 28, 2004 at 21:10 UTC
    The obvious thing is to wonder whether the error is occuring prior to you printing the headers. So perhaps a compile-time error. Have you looked at your error log?
      Yes. The premature end of script headers is the only error given. Plus, the script runs fine and the output is fine when run from the command line.


      dsb
      This @ISA my cool %SIG
Re: Premature End of Script Headers
by CountZero (Bishop) on Jul 28, 2004 at 21:45 UTC
    Looks to me as if they got the configuration of their web-server messed-up and something is stopping the template from executing correctly, if it runs at all.

    Is this the only script+template that doesn't work or are they all "broken"?

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      Yeah I should've mentioned that...no cgi scripts work - with or without a template file.

      However, I got in touch with the sysadmin of the hosting site and he said that they use the seuxec wrapper so my scripts were in the wrong group to work correctly. I'll have to find out if I'm going to have to contact him everytime I write another script. WOn't that be fun :).

      Thanks for the help anyhow.


      dsb
      This @ISA my cool %SIG
        Well you can of course ask him to make you a hundred "dummy" files with the right permissions, so you can fill them with your scripts as you write them.

        CountZero

        "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re: Premature End of Script Headers
by beable (Friar) on Jul 29, 2004 at 01:03 UTC

    What about a really simple CGI program? Does that work?

    #!/usr/bin/perl use strict; use warnings; use CGI qw/:standard/; print header, start_html('Does CGI Work?'), h1('Does CGI Work?'), "<a href='http://www.perl.org/troubleshooting_CGI.html'>", "Have you checked the CGI troubleshooting guide?</a>", end_html, "\n"; __END__

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-09-23 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (210 votes), past polls