in reply to Re: CGI and why?
in thread CGI and why?

You can get the same result with:

%param = $q->Vars;

cheers

tachyon

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

Replies are listed 'Best First'.
Re^3: CGI and why?
by Aristotle (Chancellor) on Dec 31, 2002 at 22:44 UTC
    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

        People can submit arbitrary information besides the fields I specified on the form, you know. :) It also documents the parameters I expect to have to some degree - much easier to find them all there than search the file for ->param( and much more unlikely that I'll forget to untaint something if I explicitly ask for everything in one place rather than scatter param calls here, there and everywhere. Consider it an approximation of being strict about my form parameters.

        Makeshifts last the longest.