EVIL ALERT: japhy is being cruel and unusual. There are EIGHT characters in the code given.
// /g;

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a (from-home) job
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: Can you guess what this code does?
by japh (Friar) on Apr 17, 2002 at 23:45 UTC
    It evaluates an empty match and tries to divide it by bareword 'g', resulting in division by zero.
      I guess I won't post an node to get a Illegal division by zero golf challenge without numbers, since we have a winner, unless you want to try to golf this more. (Similar to (Golf) Segfault Perl).
        I guess I won't post an node to get a Illegal division by zero golf challenge without numbers, since we have a winner, unless you want to try to golf this more. a/b 3 characters.
      Well, not when I run that code. The code you ran probably has 6 characters. The code I run has 8. Hint: my code is a substitution -- that means one of the characters you "can't see" is an "s".

      _____________________________________________________
      Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a (from-home) job
      s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

        There are 24 characters in my answer.
        turns "\r"s into "\r\n"s
                - tye (but my friends call me "Tye")
        $ wget -qO japhy.pl "http://perlmonks.org/index.pl?node_id=160033&displaytype=displaycode"
        $ cat japhy.pl 
        //
        /g;
        
        
        $ wc japhy.pl 
              4       2      10 japhy.pl
        $ perl -nle 'print join " ", map {ord} split//' japhy.pl
        47 47 13
        47 103 59
        
        
        $ perl japhy.pl 
        Illegal division by zero at japhy.pl line 1.
        $ perl -v
        
        This is perl, v5.6.1 built for i386-linux
        
        
        4 lines, 2 words, 10 characters - six ord'd plus 4 newlines.

        There's a DOS-style \r on line 1 but I don't have a cygwin box handy to see if behavior is different in Windows.

        Another hint?

Re: Can you guess what this code does?
by graff (Chancellor) on Apr 18, 2002 at 07:57 UTC
    My Theory: The difficulty (challenge) of this problem is that japhy was unable to convey all 8 characters of the code into the posting (at least, not without giving it away); if rendered explicitly (requiring more than 8 characters), it would look like this:
    s/\x08/\n/g;
    which has the effect of replacing all ASCII 008 bytes (back-space characters) with newlines.
      The correct explicit form is:
      s/\r/\n/g;
      This can be rendered in emacs using "^Q^M" in place of "\r" and "^Q^J" in place of "\n" (or just the "return" key").
        Bravo. :) Funny about the backspace thing... when I asked the question on #perl, converter answered the same way, and then corrected himself.

        _____________________________________________________
        Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a (from-home) job
        s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

      NO! It's more subtle than that -- my version would have shown the initial "s", which is supposed to be hidden. Sorry... Back to the drawing board.
Re: Can you guess what this code does?
by tachyon (Chancellor) on Apr 18, 2002 at 07:03 UTC
    / / / / /

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print