in reply to Re: Form Validation Ideas
in thread Form Validation Ideas

For the part of your question about quickly testing a lot of params to see if they hava a value, you could do something like:
my %missing; for my $item (qw{fname sname age street city zip etc}){ $missing{$item} = param($item) ? 0 : 1; }
While you're at it you could do some basic cleansing inside the loop, and attack specific fields afterwards.
hth

Replies are listed 'Best First'.
Re^3: Form Validation Ideas
by Fletch (Bishop) on Feb 25, 2008 at 16:16 UTC

    That works until you have a parameter where "0" is a valid value.

    my @param_names = $q->param(); my %present_params; @present_params{ @param_names } = (1) x @param_names;

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.