in reply to CGI and why?

While I do agree with the points in its favour so far, it strikes me as insufficient hubris. Personally I'd probably do something like this:
my %param = map { $_ => $q->param($_) } qw( user_name gender real_name city country email confirmemail birthmm birthdd birthyy );
That also retains the visual benefit of a form-submitted parameter standing out as such throughout the program. It does lose the benefits of strict however.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: CGI and why?
by tachyon (Chancellor) on Dec 31, 2002 at 21:49 UTC

    You can get the same result with:

    %param = $q->Vars;

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      Nearly, except that retains parameters I don't care about. You might do:
      my %param; @param{@$_} = @{{ $q->Vars }}{@$_} for qw( user_name gender real_name city country email confirmemail birthmm birthdd birthyy );
      ... but, errm. :)

      Makeshifts last the longest.

        It might not be unreasonable to ask this question: "If you are not interested in the params why have them in your form?" You only get form params with Vars() not the CGI object.

        One potentially useful thing you don't do but could is to ensure that the values are defined so you avoid warnings if you are using eq, ne or doing an untaint.

        my %param; $param{$_} = $q->param($_) || '' for $q->param(); # or a fixed list of + params ;-)

        cheers

        tachyon

        s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print