http://www.perlmonks.org?node_id=1009232


in reply to Re^2: Filtering unwanted chars from input field
in thread Filtering unwanted chars from input field

Thank you, johngg. Not sure why I complicated it. Yours is, indeed, a more elegant and readable solution (++). Was brought back to this node after the following should-have-done-this-in-the-first-place solution occurred to me:

$str =~ s/[^$acceptable]//gi;

Edited my original comment to reflect this...