From: "Bradley J. Seward" <[EMAIL PROTECTED]>
> >> but the two "keyword" variables are completely unrelated.
>
> Not sure what you mean? I know they are separate, which means the
> elsif is unaffected by the other... if I understand.
I mean ... you are passing the parse_input() a variable, and later on
use a different variable.
> But here's the parse_input subroutine:
>
>
> sub parse_input
> {
>
> if ($ENV{'REQUEST_METHOD'} eq 'POST')
> {
> read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
> } else
> {
> $temp=$ENV{'QUERY_STRING'};
> }
>
> @pairs=split(/&/,$temp);
>
> foreach $item(@pairs)
> {
> ($key,$content)=split (/=/,$item,2);
>
> if($content eq '')
> {
> $keyword{$key}="\0";
This looks really really strange.
It would be better to use either empty string or undef in case the
variable was empty.
> } else
> {
> $content=~tr/+/ /;
> $content=~ s/%(..)/pack("c",hex($1))/ge;
>
> if (!defined($keyword{$key}))
> {
> $keyword{$key}=$content;
> } else
> {
> $keyword{$key} .= "\0$content";
> }
> }
> }
> }
Why to you pass anything to parse_input()? It ignores its parameters
and writes the query variables into global variable %keyword!
Please
use CGI;
Using custom query parsing procedures it not recommended.
Jenda
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]