I recently (yesterday) upgraded my Perl to 5.6.1 (from 5.6), and also upgraded CGI to the most recent version (from 2.78 to 2.81). I have a strange problem with a script that has worked just fine before the upgrade.

The script edits database rows, and takes in a fair bit of information from other database tables. When the script is called to either print out the rows of a table, or delete rows, it works fine. When it is called to enter data, or edit data, it seems to simply, barf. I don't have a better word for this, because the only error I get (if I get one) is "Premature end of script headers". Sometimes, if I have it print some output, it won't give me an error, but stop in the middle of the output. It's quite strange. Here's the first part of the code - the error definitely happens in here - it doesn't get further in the script.

#!/usr/bin/perl -wT use strict; use DBI; use CGI ':standard'; use Date::Calc qw(:all); use vars qw(@form_elements $login_id); ################################################################## # # parse the input form # ################################################################# my %query = (); my %configs = (); my %meta_configs = (); my $q = new CGI; foreach ($q->param) { $query{$_} = $q->param("$_"); } print $q->header; print $q->start_html(-title=>'XINA Database Editing'); ################################################################# # # Let's get the configurations necessary # ################################################################## # foreach (keys %query) {print; print":$query{$_}<br>\n";} # first, the meta_configs: my $meta_conf; if (!$query{meta}) {$meta_conf = "xina_meta.conf";} else { $meta_conf = $query{meta}; if ($meta_conf =~ /^([-\w.]+)$/) {$meta_conf = $1;} else {#will log it } } open (CONFIG, $meta_conf) or &graceful_exit("Can't open meta config fi +le!"); my @meta_configs_file = <CONFIG>; foreach (@meta_configs_file) { chomp; if (/^#|^\n/) { next; } else { (my $var, my $val, my @more_vals) = split ('='); if($var) {$var =~ s/\ $//;} if ($val) {$val =~ s/^\ //;} if ($var) { if(!$more_vals[0]) {$meta_configs{$var} = $val;} else { my $more_vals = join('=',@more_vals); $meta_configs{$var} = $val."=".$more_vals;} } } } foreach (keys %meta_configs) { print "$_:$meta_configs{$_}<br>\n";}
Suggestions, Ideas, things I'm stupidly missing? (It doesn't seem to matter how big the query string is - even sending small query info, by Post or Get, gives me the same result.)

In reply to Strange problem on upgrading Perl and CGI by michellem

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.