Is there a better way? What if another character(s) gets in because its not listed in the subroutine?sub filter { my $str=shift; for ($str) { return '' unless $_; s/\s+//g; s/'/\\'/g; tr{\*<>;()\"\'?#\/}{}d; s/<script//g; } $str; }
In reply to Filtering unwanted chars from input field by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |