in reply to Re^39: Interleaving bytes in a string quickly
in thread Interleaving bytes in a string quickly

If you regard the fact that you can currently get away with passing silly numbers to chr, as a feature, then every other operation that you can apply to a string, contains a bug. That's lots of bugs.

At best, you've describe a terminally broken feature. More likely, simply a bug.

And along the way, wasted a lot of people's time in the process. By drip-feeding obscure hints and innuendos, instead of posting a simple, clear explanation of what you were alluding to.

Do not bother replying further, because I'm not interested in your games anymore.


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"
  • Comment on Re^40: Interleaving bytes in a string quickly

Replies are listed 'Best First'.
Re^41: Interleaving bytes in a string quickly
by ikegami (Patriarch) on Mar 02, 2010 at 23:45 UTC

    then every other operation that you can apply to a string, contains a bug. That's lots of bugs.

    Not even close to every other.

    chompworks
    chopDoesn't work (returns undef and changes nothing)
    chrworks
    indexworks
    lcworks
    lcfirstworks
    lengthworks
    m//works
    ordworks
    qq//works
    reverseworks
    rindexworks
    s///works
    sprintfworks
    substrworks
    tr///works
    ucworks
    ucfirstworks
    .works
    Hash keyworks

    By your definition /\N{}/ and /i aren't features since they can segfault Perl and return bad values for all ops that use the regex engine.

    Update: Oops, chomp does work. Fixed.

      use Data::Dumper;; $a=''; $a .= chr 1<<$_ for 0 .. 63;; print Dumper $a;; Malformed UTF-8 character (byte 0xfe) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xfe) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xfe) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xfe) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xfe) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xfe) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xfe) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xfe) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xfe) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xfe) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. Malformed UTF-8 character (byte 0xff) in subroutine entry at C:/Perl64 +/lib/Data/Dumper.pm line 190, <STDIN> line 18. $VAR1 = "&#9786;&#9658; \@\x{80}\x{100}\x{200}\x{400}\x{800}\x{1000}\x +{2000}\x{4000}\x{8000}\x{10000}\x{20000}\x{40000}\x{80000}\x{100000}\ +x{200000}\x{400000}\x{800000}\x{1000000}\x{2000000}\x{4000000}\x{8000 +000}\x{10000000}\x{20000000}\x{40000000}

      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.
      $a = join '', map ord, 65536, 65, 2**32, 65, 2**48, 65;; print length $a;; 12

      $a=''; $a.=chr 1<<$_ for 0 .. 63;; print ord unpack 'x[U]x[U]x[U]x[U]x[U]x[U]x[U]x[U]x[U]x[U] U1', $a;; 48
      use Data::Dump qw[ pp ];; pp $a;; [Malformed UTF-8 character (fatal) at C:/Perl64/lib/Data/Dump.pm line +458, <STDIN> line 20.
      use String::LCSS_XS qw[ lcss ];; $a=''; $a .= chr 1<<$_ for 0 .. 63;; print lcss( substr( $a, 10, 10 ), $a );; ðÇÓáÇßÇÇÔÇÇõÇÇÞÇÇ­ÉÇÇ­áÇDZÇÇÇ&#8215;ÇÇÇ 0 13
        I'm not sure what you're expecting from printing non-characters. Switching to Dump shows the right output is returned:
        SV = PV(0x98d16d0) at 0x98d4760 REFCNT = 1 FLAGS = (TEMP,POK,pPOK,UTF8) PV = 0x99243c0 "\320\200\340\240\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"\0 [UTF8 "\x{400}\x{800}\x{1000}\x{2000}\x{4000}\x{8000}\ +x{10000}\x{20000}\x{40000}\x{80000}"] CUR = 33 LEN = 36

        Note that you need the latest version. 1.0 only supported string of bytes in the 8-bit string format.

      length works

      reverse works

      Funny definition of "works":

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

      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 don't get that.
        $ perl -le' > $a=""; $a .= chr 1<<$_ for 0 .. 63; > print length $a; > $a = reverse $a; > print length $a; > ' 64 64
        Maybe it's cause I'm on a 32-bit build? $a contains 0..31,0..31 and the reverse once reversed.