mike wrote:
> 
> This is an interesting question; I use the following function, and have used
> it for a couple of years.  I have always thought decoding the QUERY_STRING
> or reading the STDIN buffer was faster than compiling a module at run time.
> This commonly used function returns a Hash and it has been able to handle
> all of my simple CGI challenges.  So which way is faster?
> 
> # Returns a Hash Array, i.e. %DATA=&parseFormData;
> sub parseFormData
>         {
>         my ($buffer,$name,$value,%contents);
>         $buffer = ($ENV{'REQUEST_METHOD'} eq "POST")? read(STDIN, $_,
> $ENV{'CONTENT_LENGTH'}):$ENV{'QUERY_STRING'};
>         foreach (split /&/, $buffer)
>                 {
>                 ($name, $value) = split /=/;
>                 ($name, $value) =~ tr/+/ /;
>                 ($name, $value) =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>                 $contents{$name} = $value;
>                 }
>         return %contents;
>         }

What do you do when it is a POST and there are QUERY_STRING args present?
(And yes, I do this all the time :).

-- 
  ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
 (_/   /  )    // //       DBE Collectibles   http://www.wgn.net/~dbe/
  / ) /--<  o // //      Mailto:[EMAIL PROTECTED]   http://dbecoll.webjump.com/
-/-' /___/_<_</_</_    http://www.freeyellow.com/members/dbecoll/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to