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.
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.)#!/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";}
In reply to Strange problem on upgrading Perl and CGI by michellem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |