Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Substitute values

by vinoth.ree (Monsignor)
on Mar 13, 2009 at 13:00 UTC ( #750396=note: print w/replies, xml ) Need Help??


in reply to Substitute values

tr/// only replaces characters for characters. It is very limited but faster than s/// for simple character replacing. s/// is a full blown regexp that can use all of perls various options for pattern matching and substitution. For example if all you wanted to do was replace all A's with Z's tr is the better choice: tr/A/Z/; tr/// can't even use case insensitive matching so to replace all 'A' and 'a' with 'Z' you have to do this: tr/aA/Z/; the only useful option with tr/// is the range operator: tr/a-z/A-Z/

For more information see the link

Click Here

Replies are listed 'Best First'.
Re^2: Substitute values
by almut (Canon) on Mar 13, 2009 at 15:45 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2021-12-01 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?