Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: What is the difference between s/ and tr/

by dze27 (Pilgrim)
on Apr 15, 2003 at 16:00 UTC ( #250604=note: print w/replies, xml ) Need Help??


in reply to What is the difference between s/ and tr/

I think you might have been originally confused because in certain very specific cases, tr/ and s/ do the same thing. For example, s/a/b/g is the same as tr/a/b/ -- they both replace all instances of a with b. Anything more complex than this and it doesn't work though. You need to think of these as completely separate functions.
  • Comment on Re: What is the difference between s/ and tr/

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2021-10-21 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (83 votes). Check out past polls.

    Notices?