Hello All,
      I think I figured it out, (so far). I 'm pretty sure that it has to do
with perl 5.003 disliking the looping with the "my $pair" syntax.
As a work around, I changed this....

  foreach my $pair (split(/[&;]/, $submission)) {
        # Convert plus to space
        $pair =~ y/+/ /;

         # Split into key and value.
         my ($name, $value) = split(/=/, $pair, 2); # splits on the first =.

         # Convert %XX from hex numbers to character
         $name  =~ s/%([A-Fa-f0-9]{2})/pack("c", hex($1))/ge;
         $value =~ s/%([A-Fa-f0-9]{2})/pack("c", hex($1))/ge;

         # Associate key and value
         $ENTRY{$name} .= "\0" if (defined($ENTRY{$name}));
         $ENTRY{$name} .= $value;
     }

Into this....(with slight style differences)
{

    # Split the name-value pairs
        my $pair;
        for $pair (split(/[&;]/, $submission)) {
            # Convert plus to space
            $pair =~ y/+/ /;

            # Split into key and value.
            my ($name, $value) = split(/=/, $pair, 2); # splits on the first
=.

            # Convert %XX from hex numbers to character
            $name  =~ s/%([A-Fa-f0-9]{2})/pack("c", hex($1))/ge;
            $value =~ s/%([A-Fa-f0-9]{2})/pack("c", hex($1))/ge;

            # Associate key and value
            $ENTRY{$name} .= "\0" if (defined($ENTRY{$name}));
            $ENTRY{$name} .= $value;
        }
    }

And it worked! Thanks to Bob, Scott, and Tim for all the help! Now all
that's left is to bug the right people so that an actual up to date version
of perl gets installed. :)
Luke

----- Original Message -----
From: "Cool Hand Luke" <[EMAIL PROTECTED]>
To: "Bob Showalter" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, March 28, 2003 1:02 AM
Subject: Re: The very un-useful 'premature end of script headers' error me
ssage


> > 1. You *MUST* examine the server's error log. "Prematue end of script
> > headers" is just a generic message put out by Apache when it couldn't
find
> > the response header your script should have put out. Any error messages
> > output by Perl or your script will be found in the error log. Until you
> can
> > see those logs, we're just guessing.
>
> Hi just thought I'd let y'all know I've figured out how to get more
> effective error messages. I decided to start from scratch with the
original
> sample script I posted....here's my error message now.
>
> Missing $ on loop variable at SimLib.pm line 57.
> BEGIN failed--compilation aborted at sim.pl line 25.
> Obviously it's the SimLib.pm module that the perl interpreter is having
> probs with. I checked the SimLib.pm module and here's what I've got for
> lines 38 on. I've put a comment on line 57. I can't seem to find the
> problem. I don't see where it's missing the $.
> Thanks any and all for your help.
> Luke
>
> sub get_submission {
>     my %ENTRY = ();
>     my $GetPost = '';
>     my $GetGet = $ENV{'QUERY_STRING'};
>
>     my $cl = $ENV{'CONTENT_LENGTH'};
>     if (defined{$cl}) {
>         binmode(STDIN);
>         while ($cl > 0 && read(STDIN, $_, $cl) > 0) {
>             $GetPost .= $_;
>             $cl -= length($_);
>         }
>         close STDIN;
>     }
>
>     my $submission = $GetGet . $GetPost;
>     chomp $submission;
>
>     # Split the name-value pairs
>     foreach my $pair (split(/[&;]/, $submission)) {   #LINE 57 - the one
> that has a poor loop variable that needs $
>         # Convert plus to space
>         $pair =~ y/+/ /;
>
>         # Split into key and value.
>         my ($name, $value) = split(/=/, $pair, 2); # splits on the first
=.
>
>         # Convert %XX from hex numbers to character
>         $name  =~ s/%([A-Fa-f0-9]{2})/pack("c", hex($1))/ge;
>         $value =~ s/%([A-Fa-f0-9]{2})/pack("c", hex($1))/ge;
>
>         # Associate key and value
>         $ENTRY{$name} .= "\0" if (defined($ENTRY{$name}));
>         $ENTRY{$name} .= $value;
>     }
>     return %ENTRY;
> }
>
>
> > 1. You *MUST* examine the server's error log. "Prematue end of script
> > headers" is just a generic message put out by Apache when it couldn't
find
> > the response header your script should have put out. Any error messages
> > output by Perl or your script will be found in the error log. Until you
> can
> > see those logs, we're just guessing.
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to