Hi There,

Here is another one I always use :

sub parse_form {

  read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    if (length($buffer) < 5) {
          $head = $ENV{QUERY_STRING};
     }

   @pairs = split(/\?/, $head); # split vars using ? as delimitor
    foreach $pair(@pairs) {
       ($name, $value) = split(/=/, $pair); # split var and value using = as delim.

       $value =~ tr/+/ /;
       $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

       ${$name} = $value;
    }
 } # End sub parse_form

Good luck !

David
> 
> Most recent editions of Perl come with the CGI module,
> which is what you want. Type "perldoc CGI" at your
> friendly neighborhood command prompt. The O'Reilly
> book "CGI Programming with Perl" has a good overview,
> as do no doubt countless other books.
> 
> The basic steps are:
> 
> use CGI;
> my $cgi = new CGI;   # Optional O-O interface
> print $cgi->header, $cgi->start_html("My Page");
> print $cgi->param("foo");  # print value of "foo"
> param
> print $cgi->end_html;
> 
> Note that you can also use it to output the HTML
> response, although you don't have to. More details in
> documentation.
> 
> - John
> 
> --- Conan Chai <[EMAIL PROTECTED]> wrote:
> > hi,
> > 
> > are there any perl modules that splits the http
> > request headers into name/value pairs?
> > 
> > Conan
> > It Will Come To Us !!!
> > [EMAIL PROTECTED]
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
> http://games.yahoo.com/
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to