#!C:\Perl\bin\perl.exe use strict; use warnings; sub readPostInput() { my (%searchField, $buffer, $pair, @pairs); if ($ENV{'REQUEST_METHOD'} eq 'POST') { read (STDIN,$buffer,$ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { my ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $searchField{ $name } = $value; } } } my %postInputs = readPostInput(); print "Content-type: text/html\n\n"; print "Complete :: $ENV{'REQUEST_METHOD'}";