Read the perlop manpage, under regex operators. Actually, if you look it up in perlfunc it will point you there.

If the /c modifier is specified, the SEARCHLIST character set is complemented. If the /d modifier is specified, any characters specified by SEARCHLIST not found in REPLACEMENTLIST are deleted.
So, /c is like the [^... in a character class. That means your first example, '3','5', '7', really means everything except those three characters. So, characters \0, \1, and \2 all map to '8'. With the /d flag, anything not in the replacement set (if the replacement set is shorter than the match set) is deleted.

So, the three chars you specified are kept, and everything other than those 6 are deleted. That matches your output: \0 -> '8', \1 -> '8', \2 -> '8', '3' -> '3', '5' -> '5', '7'->'7', and everything else is deleted.

—John


In reply to Re: Inconsistent transliteration for non-printing octets by John M. Dlugosz
in thread Inconsistent transliteration for non-printing octets by diotalevi

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.