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; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: tr///c doesn't seem to work as I expect
by AnomalousMonk (Archbishop) on Sep 04, 2009 at 23:42 UTC | |
Re^4: tr///c doesn't seem to work as I expect
by romandas (Pilgrim) on Sep 04, 2009 at 20:57 UTC |
In Section
Seekers of Perl Wisdom