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


in reply to leaving only [a-zA-Z0-9]

See perlop "Quote-like operators".

$a =~ tr[A-Za-z0-9][]cd;

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail