Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Multiple testing methods

by BigLug (Chaplain)
on Sep 26, 2004 at 21:37 UTC ( [id://394012]=note: print w/replies, xml ) Need Help??


in reply to Re: Multiple testing methods
in thread Multiple testing methods

I'd go with something similar to the above, but remove some stuff:
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>); }
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.

Cheers!
Rick
If this is a root node: Before responding, please ensure your clue bit is set.
If this is a reply: This is a discussion group, not a helpdesk ... If the discussion happens to answer a question you've asked, that's incidental.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://394012]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 04:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found