Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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

by Heidegger (Hermit)
on Apr 15, 2003 at 15:03 UTC ( #250586=note: print w/replies, xml ) Need Help??

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

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.

  • Comment on Re: What is the difference between s/ and tr/

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2022-01-29 14:01 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (74 votes). Check out past polls.