My cgi file errors out with 'Premature end to script headers'. I'm using CGI::Carp to output the errors to the browser. I've come across this error before, and I believe I have the most common problem solved with 'print $q->header;' This script, which grabs info from a table and prints a report, worked fine on this database installation on another server. I'm reviving it and continuing on a different machine. I checked the apache log, and it indicates a compilation error on line 7:

Tue Feb 10 22:28:12 2009 error client 127.0.0.1 BEGIN failed--compilation aborted at H:/xampp/cgi-bin/generate_report.cgi line 7.\r, referer: http://localhost/select_report.php?school_name=ACES
The first few lines look like this:

#!c:/Perl/bin/perl -w # PERL MODULES WE WILL BE USING use Net::Telnet; use Net::Telnet::Cisco; use DBI; use DBD::mysql; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use dbConnect;


Line 7 is 'DBD::mysql;' and that is currently installed in the library and is version 4.007. Any suggestions?

Regards,
Scott

In reply to Premature End Script Headers by spickles

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.