It also means that you now have a mechanism that will allow you to construct a string of packed integers that Perl has no way of unambiguously deconstructing.

I don't understand this at all.

This is what I mean:

$a = ''; $a .= chr 1<<$_ for 0..63;; Dump $a;; SV = PVMG(0x37b528) at 0x3058a0 REFCNT = 1 FLAGS = (SMG,POK,pPOK,UTF8) IV = 0 NV = 0 PV = 0x3cb90f8 "\1\2\4\10\20 @\302\200\304\200\310\200\320\200\340\2 +40\200\341\200\200\342\200\200\344 ... \200"\0Malformed UTF-8 character (byte 0xfe) in subroutine entry Malformed UTF-8 character (byte 0xfe) in subroutine entry Malformed UTF-8 character (byte 0xfe) in subroutine entry Malformed UTF-8 character (byte 0xfe) in subroutine entry Malformed UTF-8 character (byte 0xfe) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry Malformed UTF-8 character (byte 0xff) in subroutine entry [UTF8 "\x{1}\x{2}\x{4}\x{8}\x{10} @\x{80}\x{100}\x{200}\x{400}\x{800} \x{1000}\x{2000}\x{4000}\x{8000} \x{10000}\x{20000}\x{40000} CUR = 504 LEN = 512 MAGIC = 0x3c856c8 MG_VIRTUAL = &PL_vtbl_utf8 MG_TYPE = PERL_MAGIC_utf8(w) MG_LEN = -1 print join '-', map ord( chop $a ), 1 .. 64;; 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0- +0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0

And:

$a = ''; $a .= chr 1<<$_ for 0..63;; print length $a;; 64 $a = reverse $a;; Malformed UTF-8 character (byte 0xfe) in reverse at (eval 47) print length $a;; 75

If Perl can't handle it, it's a bug, not a feature. And not something I would concern myself with trying to handle.

Yet another, just another red herring.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"I'd rather go naked than blow up my ass"

In reply to Re^38: Interleaving bytes in a string quickly by BrowserUk
in thread Interleaving bytes in a string quickly by BrowserUk

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.