in reply to Re: Re: Re: Re: Clean URLs and CGI.pm
in thread Clean URLs and CGI.pm

Trimbach is politely trying to point out that you are missing both a common idiom and a feature of CGI.pm, namely that a query string without ampersands is treated as an ISINDEX search and the values can be retrieved with the keywords() method, though from my reading it's a list you'll need to join.

A small change to your code would make it work. I expect something more elegant could be done with a [0], but not by me :(

$page->param('field',join('',$page->keywords)) unless $page->param('field');

Replies are listed 'Best First'.
Re:(6) Clean URLs and CGI.pm
by swiftone (Curate) on Jun 12, 2001 at 00:50 UTC
    Ah, a few things weren't clear. For one, the documentation doesn't mention that keywords() returns false when a non ISINDEX style is used.

    How about:

    $page->param('Field',[$page->keywords()]->[0]) if $page->keywords();