With all due respect, please don't direct people to the CGI101 Web site. While the information generally seems to be correct, the Perl is simply awful and the author uses the standard broken method of parsing form data.
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
Right off the top of my head, I count six bugs (or limitations, depending upon one's point of view) in that code. Dangerous stuff to recommend :)
Cheers,
Ovid
New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text) |