in reply to CGI Forms

Maybe what you are looking for is this:

use strict; use CGI; my $q = CGI->new(); for my $p ( $q->param ) { my @vals = $q->param( $p ); print "$p: @vals<br>\n"; }
See the docs for more details on the param method.

the lowliest monk

Replies are listed 'Best First'.
Re^2: CGI Forms
by perleager (Pilgrim) on Jun 09, 2005 at 18:40 UTC
    Hey,

    Doesn't the '$q->param' method retrieve a list of parameters passed through each key?

    From the CGI doc:

    If the script was invoked with a parameter list (e.g. "name1=value1&name2=value2&name3=value3"), the param() method will return the parameter names as a list. If the script was invoked as an <ISINDEX> script and contains a string without ampersands (e.g. "value1+value2+value3") , there will be a single parameter named "keywords" containing the "+"-delimited keywords

    Is it me or am I reading the question wrong about him wanting each key value?

    perleager

      param is a weird function. Loosely speaking, with no args it returns the names of the params, but with a param name as argument it returns the value(s) of the so-named param.

      the lowliest monk