in reply to Multiple testing methods
I think what you need here is an error flag. Do both tests, and if either fails, set the error falg to a true value, then do your print statments based on the value in the error flag. See Below:
my $error = 0; my $message = ''; if($char_keywords > 950){ $error++; $message = "You had $char_keywords chars. Max is 950"; } if(&failrepeattest()){ $error++; $message .= '<br />' if(length($message)); $message .= 'Repeated keyowrd error message.'; } if($error){ print qq(<td><font color="red">Keywords: </font></td>); print qq(<td><font color="red">$message</font><br>); }else{ print qq(<td>Keywords: </td>); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multiple testing methods
by BigLug (Chaplain) on Sep 26, 2004 at 21:37 UTC |