Transliterate: transliterates all occurrences of the characters found in the search list with the corresponding character in the replacement list. It returns the number of characters replaced or deleted.
Substitute replaces the first regexp with the second.
In your example transliterate changes the new line character (\n) with the character '<'. In your example substitute changes the first regexp (2 new lines) with a HTML break.
In reply to Re: What is the difference between s/ and tr/
by Heidegger
in thread What is the difference between s/ and tr/
by abhishes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |