I'm trying out the transliteration operator with normally non-printing octet values largely to understand who it works. On it's fact it's just non-intuitive and I'm asking for help here. You'll notice from both of these cases that the transliteration patterns are both of the same format - three characters with three other characters using the /c invert and /d delete modifiers. The first example behaves normally while the second does an odd thing before hitting the expected patterns.

So can someone explain what I'm doing wrong here or where the bug is? I don't even know which should be the expected behavior. I get these results on OpenBSD perl 5.6.1, W2K ActiveState perl 5.6.1 build 633 and W2K Cygwin perl 5.8.0. I'm using this without unicode so I'm specifically referring to "character" as "octet" to avoid confusion.

$_ = "1234567890"; tr [357] [888]cd; print $_, $/; # prints 357 $_ = join '', map chr(), 0 .. 0x1f; tr [\3\5\7] [\10\10\10]cd; print join('', map sprintf("\\%o",ord), split //), $/; # prints \10\10\10\3\5\7
__SIG__ use B; printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B::svref_2object(sub{})->OUTSIDE;

In reply to 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.