I was working on a perl script that was working just fine except now it won't even compile because "Premature end of script headers" I've searched all over the script but I have yet to be able to find what this is referring too.. please help...
#!/util/bin/perl ###################################################################### +##### use CGI qw/:standard :html3 param/;; use CGI::Carp qw(fatalsToBrowser carpout); BEGIN{ print "Content-type: text/html\n\n"; open(STDERR, ">&STDOUT"); $| = 1; print ''; } ######################### #Beginning of Javascript ######################### #$JSCRIPT=<<JSEND; # if (navigator.appVersion.indexOf("PPC") != -1 || navigator.appVer +sion.indexOf("68K") != -1 || navigator.appVersion.indexOf("Mac")!= -1 +) # { # document.write("<LINK REL=\'STYLESHEET\' TYPE=\'text/css\' HR +EF=\'http://www.genome.wi.mit.edu/MPR/mprStyleMac.css\'>"); # } # else # { # document.write("<LINK REL=\'STYLESHEET\' TYPE=\'text/css\' HR +EF=\'http://www.genome.wi.mit.edu/MPR/mprStyle.css\'>"); # } # function moveover(txt) # { # window.status = txt; # } # #JSEND # #; #End of Javascript ###################################################################### +###### #NEW CGI OBJECT my $query = new CGI; #PRINT HEADER print $query->header; print $query->start_html( -title=>'Add to the Cancer Genomics Online Library'); # -script=>$JSCRIPT); #PRINT TITLE &print_title; #PRINT FORM print "<h2>Cancer Genomics Online Library Addition Form</h2>\n"; if ($query->param('Action') eq 'Submit') { # we have some data print "<h2>Entry Results</h2>\n"; # check data if (&check_entry($query) == 0) { &print_success($query); &make_entry($query); } else { print "<HR><H2>Errors Found</H2>\n"; print "<P>Please correct the errors above on the form below.\n +"; &print_form($query); } } else { &print_intro; &print_form($query); } &print_tail; print $query->end_html; #End of Program ###################################################################### +########### sub print_title { print "<table valign=top>\n"; print "<tr><td valign=top width=150><br>menubar will go here.</td> +\n"; print "<td valign=top align=left width=600><br>\n"; } sub print_intro { print"<p>Welcome to Cancer Genomics Online Library Addition Form.\ +n"; print"<p> Please fill in all relevant information.\n"; } sub print_form { my($query) = @_; my $width = 50; print $query->start_multipart_form; print "<h3><font color = red>Your Information</font></h3><p>"; print "<table>\n"; print "<tr><td><B>Your Name:</B></td><td>"; print $query->textfield( -name=>'yourname', -size=>$width); print "<td></tr>\n"; print "<tr><td><B>Your E-mail Address:</B></td><td>"; print $query->textfield( -name=>'youremail', -size=>$width); print "<td></tr>\n"; print "<tr><td><B>Your Daytime Phone:&nbsp&nbsp&nbsp</B></td><t +d>"; print $query->textfield( -name=>'yourphone', -size=>15); print "<td></tr>\n"; print"</table>\n"; print "<h3><font color = red>Entry Information</font></h3><p>"; print "<table>\n"; print "<tr><td><B>Publication Title:</B></td><td>"; print $query->textfield( -name=>'pubtitle', -size=>$width); print "<td></tr>\n"; print "<tr><td><B>Publication Author:</B></td><td>"; print $query->textfield( -name=>'pubauthor', -size=>$width); print "<td></tr>\n"; print "<tr><td><B>Date of Publication:</B></td><td>"; print $query->textfield( -name=>'pubdate', -size=>$width); print "<td></tr>\n"; print "<tr><td><B>Journal of Publication:</B></td><td>"; print $query->textfield( -name=>'pubjournal', -size=>$width); print "<td></tr>\n"; print "<tr><td><B>Online URL:</B></td><td>"; print $query->textfield( -name=>'puburl', -size=>$width); print "<td></tr>\n"; print "<tr><td><B>Category:</B></td><td>"; print $query->popup_menu( -name=>'pubcategory', -values=>['Choose a Category','Genetics','Mice','D +NA', 'None of the above'], -default=>'None', -labels=>\%labels); print "<td></tr>\n"; print "<tr><td><B>Relevant Keywords:</B></td><td>"; print $query->textfield(-name=>'pubkey1',-size=>(($width/4)-1) +); print "&nbsp&nbsp"; print $query->textfield(-name=>'pubkey2',-size=>(($width/4)-1) +); print "&nbsp&nbsp"; print $query->textfield(-name=>'pubkey3',-size=>(($width/4)-1) +); print "&nbsp&nbsp"; print $query->textfield(-name=>'pubkey4',-size=>(($width/4)-2) +); print "<td></tr>\n"; print "<tr><td><B>Additional Comments:</B></td><td>"; print $query->textarea( -name=>'pubcomments', -default=>'Add additional comments here.', -rows=>2, -columns=>($width-2)); print "<td></tr>\n"; print "<tr><td><B>Upload a copy: </B></td><td>"; print $query->filefield( -name=>'pubupload', -default=>'', -size=>($width-14), -maxlength=>100); print "<td></tr>\n"; print" </table>\n"; print $query->submit('Action','Submit'); print "&nbsp\n"; print $query->reset; print $query->endform; } sub subscribe_to_list { my($query) = @_; } sub print_success { print <<EOM; <p> Your addition to the Cancer Genomics Online Library has been succe +ssfully submitted. <p>Any Online Library Questions should go to &nbsp <a href="mailto:tamayo\@genome.wi.mit.edu"><tt>tamayo\@genome.wi.m +it.edu</tt></a>. <p>Any questions regarding the web site should go to &nbsp <a href="mailto:zhao\@mit.edu"><tt>zhao\@mit.edu</tt></a>. <p> <a href="http://waldo.wi.mit.edu/MPR/" target="_top">Back to Cance +r Genomics Home</a> EOM } sub check_entry { my($query) = @_; my($bad); $bad = 0; if ($query->param('yourname') !~ /\S+/) { $bad = 1; print "<p><b>Error</b>: Your Name field is blank\n"; } if ($query->param('youremail') !~ /\S+/) { $bad = 1; print "<p><b>Error</b>: E-mail field is blank\n"; } if ($query->param('youremail') !~ /\@/) { $bad = 1; print "<p><b>Error</b>: E-mail field doesn't have \@ sign.\n"; } if ($query->param('pubtitle') !~ /\S+/) { $bad = 1; print "<p><b>Error</b>: Publication Title field is blank.\ +n"; } if ($query->param('pubauthor') !~ /\S+/) { $bad = 1; print "<p><b>Error</b>: Publication Author field is blank. +\n"; } #if ($query->param('phone') !~ /\S+/) { # $bad = 1; # print "<p><b>Error</b>: Phone field is blank\n"; #} $bad; # return whether or not entry is good } sub make_entry { my($query) = @_; } sub print_tail { print <<END; </td></tr></table> <table> <tr><td valign=top align=left width=750> <hr> <font size=-2 face="ARIAL,GENEVA,HELVETICA,SANS-SERIF"> Dacheng Zhao <br> Last Edited: <script language="JavaScript"> <!-- hide script from old browsers lastmod = document.lastModified document.write(lastmod) // end hiding contents --> </script> <br>Contact the Webmaster at <i><a href="mailto:zhao\@mit.edu">zhao\@mit.edu</a></i> with q +uestions or comments </font> </td></tr></table> END }

In reply to 'Premature end of script headers' error by newatperl

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.