How to extract name/value pairs from the query string? - modperl

This is a discussion on How to extract name/value pairs from the query string? - modperl ; Hi, What is the recommended module to get the name/value pairs from the query string. Apache2::RequestRec::args comes close but there must be something easier to use. sub login_response { my $r = shift; my $args = $r->args(); ... } Thanks, ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: How to extract name/value pairs from the query string?

  1. How to extract name/value pairs from the query string?

    Hi,

    What is the recommended module to get the name/value pairs from the
    query string. Apache2::RequestRec::args comes close but there must be
    something easier to use.

    sub login_response {
    my $r = shift;
    my $args = $r->args();
    ...
    }

    Thanks,
    Himanshu


  2. Re: How to extract name/value pairs from the query string?

    Himanshu wrote:
    > Hi,
    >
    > What is the recommended module to get the name/value pairs from the
    > query string. Apache2::RequestRec::args comes close but there must be
    > something easier to use.
    >
    > sub login_response {
    > my $r = shift;
    > my $args = $r->args();
    > ...
    > }


    See Apache2::Request, it mirrors the CGI param api.


    >
    > Thanks,
    > Himanshu
    >



  3. Re: How to extract name/value pairs from the query string?

    Quoting Fred Moyer :
    > See Apache2::Request, it mirrors the CGI param api.


    In case you dont know, Apache2::Request is part of libapreq2
    (http://httpd.apache.org/apreq/). IMO, using it is the best way to
    achieve what you're trying to do if you're developing for mod_perl
    only. (ie you don't care if the code will run under plain CGI or not)

    Adam


  4. Re: How to extract name/value pairs from the query string?

    On Tue, Sep 23, 2008 at 12:32 PM, John Drago wrote:
    > Ha no not really. Somehow everything else must suffer (usability, debugging, intuitiveness, etc) so that we can have a *fast* web programming environment. (Yay!)


    While I agree that the splitting of the APIs you're referring to is
    strange and confusing, this actually has nothing to do with that.
    There is no parsing of form data in $r->args built into mod_perl 2
    because the previous attempt at it in mod_perl 1 was broken and
    considered a bad idea in retrospect. Both libapreq2 and the standard
    CGI module provide robust and easy-to-use parsing of form data for
    mod_perl 2.

    - Perrin


  5. Re: How to extract name/value pairs from the query string?

    2008/9/23 Perrin Harkins

    > On Tue, Sep 23, 2008 at 12:32 PM, John Drago wrote:
    > > Ha no not really. Somehow everything else must suffer (usability,

    > debugging, intuitiveness, etc) so that we can have a *fast* web programming
    > environment. (Yay!)
    >
    > While I agree that the splitting of the APIs you're referring to is
    > strange and confusing, this actually has nothing to do with that.
    > There is no parsing of form data in $r->args built into mod_perl 2
    > because the previous attempt at it in mod_perl 1 was broken and
    > considered a bad idea in retrospect. Both libapreq2 and the standard
    > CGI module provide robust and easy-to-use parsing of form data for
    > mod_perl 2.



    Thanks for the replies. Apache2::Request has the method I needed. Sorry that
    I missed it from the docs. Using CGI.pm looked odd because I was not doing
    any CGI anywhere.

    Thank You,
    Himanshu


    >
    >
    > - Perrin
    >



+ Reply to Thread