PLEASE Help with CGI Problem!

Ben Ocean zope at thewebsons.com
Tue May 1 15:56:34 EDT 2001


Hi;
I NEED to get data from the buffer after it is sent to me from a foreign 
host. Here's (apparently) how this would be scripted in perl:
 >>>
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;
}
<<<
How would I script it in Python and what modules must I call?
TIA,
BenO





More information about the Python-list mailing list