in reply to Links between Mason components?

So, CGI also stopped doing URL escaping itself, now delegating that feature to URI::Escape.

No, CGI has forever delegated the job to CGI::Util::escape()

Clearly, URI knows how to construct URLs. Of course it does. Sadly, it doesn't appear to know anything about CGI parameters in a URL.

Actually it does, see "query_form", but it is PITA ( no state, one-shot replacements), that is why URI::QueryParam, which while more convenient, still kind of a PITA

You can use CGI for this

$ perl -l use CGI; my $queryParams = { a => [qw/ a >< a/], qw/ b b><b c c><c / }; print CGI->new( $queryParams )-> query_string; __END__ c=c%3E%3Cc;a=a;a=%3E%3C;a=a;b=b%3E%3Cb

Badger::URL looked interesting, but naturally, like all interesting things, it doesn't handle something, it doesn't handle multivalued params like  fa=a;fa=b;fa=c;

Replies are listed 'Best First'.
Re^2: Links between Mason components? (CGI)
by tye (Sage) on May 18, 2012 at 03:00 UTC

    Thanks. That was helpful (and, even more so, interesting).

    The pseudo-singleton features of CGI made me unwilling to create a new CGI object in an environment that is likely already using a CGI instance. I guess I could dig into CGI.pm to see if my fears are unfounded with the current implementation and, also important, whether the documentation makes it clear that my fears should not become 'founded' in a future release of CGI.pm.

    - tye        

      I guess I could dig into CGI.pm to see if my fears are unfounded with the current implementation and, also important, whether the documentation makes it clear that my fears should not become 'founded' in a future release of CGI.pm.

      Your fears are unfounded both according to the source and the docs

      To create an empty query, initialize it from an empty string or hash )

      I remember this from source diving (which CGI.pm encourages) in the year 2000