>>>>> "TE" == Tony Esposito <tony1234567...@yahoo.co.uk> writes:

  TE> You miss my point but thanks for the syntax check.  I am concerned
  TE> with comparing the functionality, one versus the other.

they are not comparable at all. tr/// works on individual characters and
nothing else. s/// works with regexes which can modify strings as a
whole. there are a few simple cases where one can do the same as the
other such as replacing a single char with another globally. and in that
case tr/// wins for speed and better specifity.

the reason people conflate the two is becaus they share the =~ binding
op. i have seen op tables in web tutorials that incorrectly list tr///
as a regex op.

so think tr/// for chars and only chars and s/// for regexes and
strings. simple.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to