On Jul 13, Mike Flannigan said:

>>   tr/|/h/ for @filecontents;
>>
>> That transliterates ALL |'s to h's, for each string in @filecontents.
>
>Yeah, I was trying to figure out the difference from s///.  I guess it
>returns the number of characters replaced (or deleted), as opposed
>to the number of substitutions made.  That's the main difference I
>see.

tr/// is only for character-to-character translations.  It doesn't work
for strings:

  s/foo/bar/g

and

  tr/foo/bar/

do not work the same way.  tr/// is ONLY for characters.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to