in reply to Re: Easy way to run tests on many CGI params?
in thread Easy way to run tests on many CGI params?

In the second foreach loop, omitting the last; and utilizing $error:
foreach my $expect (@expected) { my $received = $q->param($expect); unless (defined $received) { $error .= "Didn't get $expect parameter!\n"; } push @request, $received; } if($error ne "") { # Handle the error here, reprinting the form, # pre-filled with what they've already sent. # Also tell them about all the problems: print $error; }

Users who don't understand "required field" tend to get really frustrated when they're only told about the first omission, because it takes them numerous iterations to get rid of all the errors.


--isotope