rodry has asked for the wisdom of the Perl Monks concerning the following question:
I wrote a script to validate the input of a form. All I
need is for the script to check if the fields are not empty.
Then, give the user a message prompting them to fill the
information required.
Since there are more than ten fields in the form, I decided it would be quicker to store the variables in an array and then iterate thru them. Sort of like this:
Is there a better way?@variablearray = \($variable1, $variable2, ....); foreach (@variablearray) { if (!$_){ $fieldempty = 1; } }
Originally posted as a Categorized Question.
|
---|
Back to
Seekers of Perl Wisdom