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

If Perl can't handle it, it's a bug, not a feature.

You can't have a bug in a feature without having a feature.

  • Comment on Re^39: Interleaving bytes in a string quickly

Replies are listed 'Best First'.
Re^40: Interleaving bytes in a string quickly
by BrowserUk (Patriarch) on Mar 02, 2010 at 12:25 UTC

    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.

      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.

        $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::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.
        use String::LCSS_XS qw[ lcss ];; $a=''; $a .= chr 1<<$_ for 0 .. 63;; print lcss( substr( $a, 10, 10 ), $a );; ðÇÓáÇßÇÇÔÇÇõÇÇÞÇÇ­ÉÇÇ­áÇDZÇÇÇ&#8215;ÇÇÇ 0 13
        use Data::Dump qw[ pp ];; pp $a;; [Malformed UTF-8 character (fatal) at C:/Perl64/lib/Data/Dump.pm line +458, <STDIN> line 20.

        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.