>> I am running into a problem with a very basic function with CGI.PM. The
code will not param correctly.
>> This first test code taken from the POD will not param any values...

------------------------

To me, cgi.pm always seemed like a big pain. You can print the form and
headers manually, and use the following cgi.pm excerpt to read the form data
(much easier).

Hope this helps, 

- Chris



print "Content-type: text/html\npragma: no-cache\n\n"; # Content type &
prevents browser caching
&parse_form; # use this function to capture both GET and POST value pairs as
%input


## Print html containing form here

sub parse_form {
   read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
   if (length($buffer) < 5) {
         $buffer = $ENV{QUERY_STRING};
    }
   @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;
      
      $input{$name} = $value;
      #print "$name: $value<br>";
   }
}

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to