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

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:

  • Problem solved - links to source code removed.
Before you ask, 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.

This @ISA my cool %SIG

Replies are listed 'Best First'.
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.

      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"?


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

      Yeah I should've mentioned 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.

      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.


        "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=''>", "Have you checked the CGI troubleshooting guide?</a>", end_html, "\n"; __END__

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://378214]
Approved by integral
[marto]: if your app just calls a remote or third party service to do the task, you app does not 'do the task', it's just a messenger
[marto]: in the sense that for various values of "a while ago" it would not have been possible (and arguable still isn't) to have a fingerprint of every piece of commercially released music to compare against.
[marto]: a co-worker refers to the late 1980s as "a while ago"
[Veltro]: Like I said before, I ment the solution as a whole
[Veltro]: People thought it was not possible.
[marto]: and until recently it wasn't and arguable (for some samples) probably isn't
[Veltro]: How did we get here? Oh yeah, advertisement. So let's get back there. What I ment to say is that I think it is possible to create an algorithm that filters out advertisement
[Veltro]: And yes, maybe your decoder needs the cloud to do so.

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2018-05-24 12:12 GMT
Find Nodes?
    Voting Booth?