in reply to Optional FONT tag

Here are a couple of ideas, first instead of making the font tag optional, just make the color optional, this will let you use a close font tag and only one compairison.
Tr (td({-align=>'right'},["<FONT ".($state==2?"COLOR=FF0000":undef)."> +First Name</FONT>"]),td({-align=>'left'},[ textfield(-name=>'user_fir +stname' ,-default=>$userinfo[0])])),
Since you are only doing one compairison you could even call your sub from within the statement.
Tr (td({-align=>'right'},["<FONT ".(val_sub($userinfo[0])==2?"COLOR=FF +0000":undef).">First Name</FONT>"]),td({-align=>'left'},[ textfield(- +name=>'user_firstname' ,-default=>$userinfo[0])])),
Another variation that I like to use is to change the background color of both cells instead of the font color of one cell (users can find the errors quicker). I hope this gives you some ideas and that other people will post how they have done this.

P.S. The above code is untested (but I did look at my previous work).