in reply to cgi_handlers.pl
Assuming that we're referring to the same code, you do not want to to use cgi_handlers.pl. Here's the relevant code section (comments removed):
sub get_request { if ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $request, $ENV{'CONTENT_LENGTH'}); } elsif ($ENV{'REQUEST_METHOD'} eq "GET" ) { $request = $ENV{'QUERY_STRING'}; } %rqpairs = &url_decode(split(/[&=]/, $request)); } sub url_decode { foreach (@_) { tr/+/ /; s/%(..)/pack("c",hex($1))/ge; } @_; }
This code has virtually all of the bugs one is likely to find in most hand-rolled code, plus some extras.
There are a variety of other issues with this code, but this is a good start. See use CGI or die; for more information.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (Ovid) Re: cgi_handlers.pl
by Ven'Tatsu (Deacon) on Nov 06, 2001 at 03:46 UTC | |
by Ovid (Cardinal) on Nov 06, 2001 at 04:16 UTC |