Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: problems with tr///;

by broquaint (Abbot)
on Sep 25, 2001 at 22:38 UTC ( [id://114621]=note: print w/replies, xml ) Need Help??


in reply to problems with tr///;

The reason it won't work is because by default tr, transliterates, or changes, character for character between the search list to the replacement list. However if you stick a 'd' on the end it will delete everything in the search list that doesn't have a corresponding replacement e.g
$var =~ tr/\\//d; # \ deleted, nothing to replace $var =~ tr/\\/X/d; # changed \ into X
As someone is bound to say RTFM (man perlop).
HTH

broquaint

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-18 07:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found