Since, everyone is so lively today, I'm going to push my luck today with
this list. I need a little help here with validating a string to have only
characters that I want, A-z and _ (underscore).
So, this is what I'm stuck on:
#should fail because of space
$username="bob by";
if(&isValidChars($username))
...
#is there a better way but it isn't working anyway.
sub isValidChars
{ my $retVal;
@chars=split(//,$_[0]);
for(@chars)
{
if($_ =~ /A-z/) { print "good [" . $_ . "]\n"; $retVal=1; }
else { print "bad [" . $_ . "]\n"; $retVal=0; break; }
}
return $retval;
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]