http://qs1969.pair.com?node_id=793592


in reply to Re^2: tr///c doesn't seem to work as I expect
in thread tr///c doesn't seem to work as I expect

From perlop:
The character "-" is treated specially and therefore "\-" is treated +as a literal "-".


The - indicates a range.

if($data !~ /^[\ \-\~\007\012\015\035\036\037]*$/) { $data =~ tr/[\ \-\~\007\012\015\035\036\037]/ /cs; }
is probably what you need.