in reply to Can you guess what this code does?

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.

Replies are listed 'Best First'.
Re: Re: Can you guess what this code does?
by graff (Chancellor) on Apr 18, 2002 at 08:13 UTC
    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:??;

Re: Re: Can you guess what this code does?
by graff (Chancellor) on Apr 18, 2002 at 08:01 UTC
    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.