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

This is a discussion on Re: How to extract name/value pairs from the query string? - modperl ; John Drago wrote: [...] > > my %args = map { my ($k,$v) = split /\=/, $_; unescape($k) => (unescape($v) } split /\&/, $r->args; > It's lines like this that make perl scripts small and perl great, and give them ...

+ Reply to Thread
Results 1 to 2 of 2

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

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

    John Drago wrote:
    [...]

    >
    > my %args = map { my ($k,$v) = split /\=/, $_; unescape($k) => (unescape($v) } split /\&/, $r->args;
    >

    It's lines like this that make perl scripts small and perl great, and
    give them both a bad name for Java programmers.
    I'm sure someone can think of a way to strip the possible leading and
    trailing spaces off the keys at the same time though.
    ;-)


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

    On Tue, Sep 23, 2008 at 2:51 PM, André Warnier wrote:
    > I'm sure someone can think of a way to strip the possible leading and
    > trailing spaces off the keys at the same time though.


    Please don't. Some of the reasons for using a well-tested parser like
    CGI or libapreq2 are listed here:
    http://perl.apache.org/docs/2.0/user..._Array_Context

    - Perrin


+ Reply to Thread