Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Module to parse form... 1

Status
Not open for further replies.

perlone

Programmer
Joined
May 20, 2001
Messages
438
Location
US
Is it just me or all my form just don't parse. I use the standard code:

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;
}

Is there any simple module that parse no matter what? I'll also check the cpan but if any of you know any other, just let me know. Thanks. :-)


-Aaron
 
Use the CGI.pm module. It is the most common module used for CGI applications. goBoating has written several FAQ's on how to use the module (some other people might have as well, his just stick out in my mind).

You can go to CPAN and download it. It's quite a bit of code written by Lincoln Stein.

Hope this helps.

-Vic vic cherubini
krs-one@cnunited.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash
====
 
Thanks, i'll try that.
 
also, for doing it yourself, the variable "$ENV{REQUEST_METHOD}" will help you out (which will be either "GET" or "POST"). "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top