in reply to Re: Re: Difference between tr// and s///?
in thread Difference between tr/// and s///?

Ah, yes, I didn't realize that originally the OP didn't use <code> tags, so I didn't notice the space.

My second point still stands though, tr/// is usually faster than s///. It is faster because tr/// is a much simpler operation. It's a character by character replacement - no copy of the string needs to be made, nor do large parts of the string be moved. An s/// operation cannot assume such a thing, replacement parts can be shorter or smaller than the thing that needs to be replaced.

Abigail