in reply to Re: Can you guess what this code does?
in thread Can you guess what this code does?

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:??;

  • Comment on Re: Re: Can you guess what this code does?

Replies are listed 'Best First'.
(tye)Re: Can you guess what this code does?
by tye (Sage) on Apr 18, 2002 at 04:25 UTC
    There are 24 characters in my answer.
    turns "\r"s into "\r\n"s
            - tye (but my friends call me "Tye")
Re: Re: Re: Can you guess what this code does?
by japh (Friar) on Apr 18, 2002 at 07:56 UTC
    $ 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?