The character "-" is treated specially and therefore "\-" is treated +as a literal "-".
is probably what you need.if($data !~ /^[\ \-\~\007\012\015\035\036\037]*$/) { $data =~ tr/[\ \-\~\007\012\015\035\036\037]/ /cs; }
In reply to Re^3: tr///c doesn't seem to work as I expect
by james2vegas
in thread tr///c doesn't seem to work as I expect
by romandas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |