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 - indicates a range.
The character "-" is treated specially and therefore "\-" is treated +as a literal "-".
The - indicates a range.
is probably what you need.if($data !~ /^[\ \-\~\007\012\015\035\036\037]*$/) { $data =~ tr/[\ \-\~\007\012\015\035\036\037]/ /cs; }
In Section
Seekers of Perl Wisdom