<snip> 
> 
> >  my @fields = qw(name email city state message);
> >  foreach my $field (@fields) {
> >   $blanks++ if !$q->param($field);
> >  }
>     for(@fields) { $blanks ++ if $q->param($_) eq ''; }
> 

IMO, I disagree that removing whitespace and switching a named variable
such as $field to $_ is an improvement.  You have also significantly
changed the functionality from the original, while this may represent an
improvement if it better matches the spec (given the variable name it
probably does), it does break the original spec.

Of course the OP should also realize that if a person enters the value
of '0' his check will fail since it is false, but in this case could be
valid (aka non-blank).  It is important to understand the difference
between a boolean true/false, and what you consider valid/invalid.

$.02...

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to