Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by broquaint (Abbot)
on Apr 15, 2003 at 15:01 UTC ( #250584=note: print w/replies, xml ) Need Help??


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

tr/// transliterates characters, and s/// substitutes, basically. In your example code, when you use tr/// you're replacing every occurance of the character \n with < in the string, whereas s/// substitutes every occurrence of the substring \n\n with <br/>. See. perlop for more info on tr/// and s///.
HTH

_________
broquaint

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2022-01-18 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (52 votes). Check out past polls.

    Notices?