Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: LWP vs CGI

by Ovid (Cardinal)
on Apr 24, 2003 at 14:24 UTC ( [id://252906]=note: print w/replies, xml ) Need Help??


in reply to Re: LWP vs CGI
in thread LWP vs CGI

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)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://252906]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-03-28 16:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found