Ok - I got it to work by changing the line to length >= 3 If I could push the rule a little further, a new rule added is that an alpha char a-Z MUST be after the period.
thanks > On Fri, Oct 10, 2003 at 03:11:52PM -0700, [EMAIL PROTECTED] wrote: >> This is not working as I expected: >> >> if(validate('abc.com')) >> { print "true"; } >> else >> { print "false"; } > > It prints "false" (because the length is > 4). > >> > sub validate { >> > local $_ = shift; >> > return( length == 4 and >> > tr/.// == 1 and >> > /^[[:alpha:]]/ ) >> > } > > What did you expect it to do? > > -- > Steve > ----------------------------------------- eMail solutions by http://www.swanmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]