# Remove everything except a-z,0-9 tr/a-z0-9//cd; # Print a warning if something besides a-z,0-9 is found print "Warning ! Did you mean '$_'? " if ( tr/a-z0-9//cd ) ; # Clarification [2001-5-29]: this is just an example, # modify the allowed chars set at your will. # You may also want to lowercase the input with 'lc' or # 'tr/A-Z/a-z/';
In reply to Cleaning user input with 'tr' by fuzzycow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |