From the perldoc:

tr/SEARCHLIST/REPLACEMENTLIST/cdsr y/SEARCHLIST/REPLACEMENTLIST/cdsr ... Options: c Complement the SEARCHLIST. d Delete found but unreplaced characters. s Squash duplicate replaced characters. r Return the modified string and leave the original string untouched. If the /c modifier is specified, the SEARCHLIST character set is compl +emented. If the /d modifier is specified, any characters specified by SEARCHLIS +T not found in REPLACEMENTLIST are deleted. (Note that this is slightly more + flexible than the behavior of some tr programs, which delete anything they find + in the SEARCHLIST, period.) If the /s modifier is specified, sequences of cha +racters that were transliterated to the same character are squashed down to a +single instance of the character. If the /d modifier is used, the REPLACEMENTLIST is always interpreted +exactly as specified.
"\n"s are being deleted because they are not specified in the replacement list.

NOTE! the /r option is relatively new and may not be present in your version of Perl. Check your local docs to be sure.

You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

In reply to Re: Meaning of command by boftx
in thread Meaning of command by grewal7634

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.