in reply to Re: Multiple testing methods
in thread Multiple testing methods
You don't need the $error flag. The $message will be empty (false) if there are no errors. I've also taken out the length() check on $message for the same reason .. if the message has length then testing it in this context will return true and the <br> tag will be output.my $message = ''; if ( $char_keywords > 950 ) { $message = "You had $char_keywords chars. Max is 950"; } if ( failrepeattest() ) { $message .= '<br />' if $message; $message .= 'Repeated keyword error message.'; } if ( $message ) { print qq(<td><font color="red">Keywords: </font></td>); print qq(<td><font color="red">$message</font><br>); } else { print qq(<td>Keywords: </td>); }
|
|---|