Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

Re^4: tr///c doesn't seem to work as I expect

by AnomalousMonk (Archbishop)
on Sep 04, 2009 at 23:42 UTC ( #793632=note: print w/replies, xml ) Need Help??

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

One small point:

In the  tr operator, the  [ and  ] characters have no special meaning. (In a 'normal' regex, they define a character set.) In the expressison (as taken from the OP)
    $data =~ tr/[\ -\~\007\012\015\035\036\037]/ /cs;
the  [ and  ] characters simply represent themselves. This has no effect in this particular case, however, since these characters are also included in the range  \ -\~ that includes, IIRC, all printable ASCII characters. (I think a space qualifies as a 'printable' character.)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://793632]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2023-09-24 21:22 GMT
Find Nodes?
    Voting Booth?

    No recent polls found