First, I misspoke a bit. Perl uses a utf8 internally, a Perl-specific derivative of UTF-8. UTF-8 can only encode values up to 10FFFF and is really meant for unicode characters, while utf8 can encode any UV.

use Devel::Peek qw( Dump ); my $array = ''; for my $bit (0..63) { $array .= chr( 1 << $bit ); } Dump($array);
SV = PV(0x511ae0) at 0x5118b0 REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK,UTF8) PV = 0x531200 "\1\2\4\10\20 @\302\200\304\200\310\200\320\200\340\24 +0\200\341\200\200\342\200\200\344\200\200\350\200\200\360\220\200\200 +\360\240\200\200\361\200\200\200\362\200\200\200\364\200\200\200\370\ +210\200\200\200\370\220\200\200\200\370\240\200\200\200\371\200\200\2 +00\200\372\200\200\200\200\374\204\200\200\200\200\374\210\200\200\20 +0\200\374\220\200\200\200\200\374\240\200\200\200\200\375\200\200\200 +\200\200\376\202\200\200\200\200\200\376\204\200\200\200\200\200\376\ +210\200\200\200\200\200\376\220\200\200\200\200\200\376\240\200\200\2 +00\200\200\377\200\200\200\200\200\201\200\200\200\200\200\200\377\20 +0\200\200\200\200\202\200\200\200\200\200\200\377\200\200\200\200\200 +\204\200\200\200\200\200\200\377\200\200\200\200\200\210\200\200\200\ +200\200\200\377\200\200\200\200\200\220\200\200\200\200\200\200\377\2 +00\200\200\200\200\240\200\200\200\200\200\200\377\200\200\200\200\20 +1\200\200\200\200\200\200\200\377\200\200\200\200\202\200\200\200\200 +\200\200\200\377\200\200\200\200\204\200\200\200\200\200\200\200\377\ +200\200\200\200\210\200\200\200\200\200\200\200\377\200\200\200\200\2 +20\200\200\200\200\200\200\200\377\200\200\200\200\240\200\200\200\20 +0\200\200\200\377\200\200\200\201\200\200\200\200\200\200\200\200\377 +\200\200\200\202\200\200\200\200\200\200\200\200\377\200\200\200\204\ +200\200\200\200\200\200\200\200\377\200\200\200\210\200\200\200\200\2 +00\200\200\200\377\200\200\200\220\200\200\200\200\200\200\200\200\37 +7\200\200\200\240\200\200\200\200\200\200\200\200\377\200\200\201\200 +\200\200\200\200\200\200\200\200\377\200\200\202\200\200\200\200\200\ +200\200\200\200\377\200\200\204\200\200\200\200\200\200\200\200\200\3 +77\200\200\210\200\200\200\200\200\200\200\200\200\377\200\200\220\20 +0\200\200\200\200\200\200\200\200\377\200\200\240\200\200\200\200\200 +\200\200\200\200\377\200\201\200\200\200\200\200\200\200\200\200\200\ +377\200\202\200\200\200\200\200\200\200\200\200\200\377\200\204\200\2 +00\200\200\200\200\200\200\200\200\377\200\210\200\200\200\200\200\20 +0\200\200\200\200"\0 [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{2000 +0}\x{40000}\x{80000}\x{100000}\x{200000}\x{400000}\x{800000}\x{100000 +0}\x{2000000}\x{4000000}\x{8000000}\x{10000000}\x{20000000}\x{4000000 +0}\x{80000000}\x{100000000}\x{200000000}\x{400000000}\x{800000000}\x{ +1000000000}\x{2000000000}\x{4000000000}\x{8000000000}\x{10000000000}\ +x{20000000000}\x{40000000000}\x{80000000000}\x{100000000000}\x{200000 +000000}\x{400000000000}\x{800000000000}\x{1000000000000}\x{2000000000 +000}..."] CUR = 504 LEN = 512

Update: First para added.


In reply to Re^32: Interleaving bytes in a string quickly by ikegami
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.