in reply to Need help with simple form input
now all your form field inputs are in a hash called "%in".use CGI; CGI::ReadParse();
The keys are the form field names. If you've got a field called "username", it's in $in{'username'} -- I know people will frown on this because it's not the correct way to go, not object-oriented, but hell, it's quick, isn't it?
Now all you have to do is a regular expression. if($in{'username'} !~ m/a-z0-9/) and you're done.
Watch out for multiple values from checkboxes or duplicate-name fields though.
--
($_='jjjuuusssttt annootthheer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;
|
|---|