http://www.perlmonks.org?node_id=70914


in reply to I refuse to explain this

The main key behind it is the use re 'eval', which allows Perl to be inside the (?{...}) considitonal regexps. Couple that with the "e" flag on s/// and it runs the loop. Now when it hits the do{}while($n), $_ is
``As`SC``Ad``S``CS`CCI``Ae``C`SI`Ed``A?``B``BIi`pI``E?``Es``C``Es``Es` +`Es``Es``Es`KI```BI``Es``Es``Es`KI``Es``Es`KI``E?``Es``Es``Es`KI``E?` +`Es``Es``Es``Es``Es`KI``E?``Es``Es``Es``Es`KI``E?``Es``C``Es``Es```BI +``Es``Es``Es`KI``Es``Es``Es`KI``Es``Es``Es`KI``E?``Ee``Ee``Es``Es``Es +``Es``Es`KI``E?``Es```BI``Es``Es``Es`KI``Es``Es`KI``E?```BI``Es``Es`` +Es`KI``Es``Es`KI``E?``Es``Es``Es``Es`KI``E?```BI``Es``Es``Es``Es`KI`` +Es``Es`KI``E?``Ee```BI``Es``Es``Es`KI``Es``Es`KI``E?``Ed``Es``Es``Es` +KI``E?``Es``C``Es``Es```BI``Es``Es``Es`KI``Es``Es``Es`KI``Es``Es``Es` +KI``E?``C``Es```BI``Es``Es``Es`KI``Es``Es`KI``Es``Es``Es``Es`KI``E?`` +Ee```BI``Es``Es``Es`KI``Es``Es`KI``E?``Ed``Es``Es``Es`KI``E?``C``Es`` +Es``Es``Es`KI``Es``Es``Es`KI``E?``Es``C``Es``Es```BI``Es``Es``Es`KI`` +Es``Es``Es`KI``Es``Es``Es`KI``E?``C```BI``Es``Es``Es``Es`KI``Es``Es`K +I``Es``Es``Es`KI``E?``Ee``Ee``Es``Es``Es``Es``Es`KI``E?``C``Ee``Es``E +s``Es`KI``Es``Es``Es`KI``E?``Ee``Ed``Es``Es``Es`KI``E?``Ee```BI``Es`` +Es``Es`KI``Es``Es`KI``E?``Ed``Es``Es``Es`KI``E?``Ed``Ee```BI``Es``Es` +`Es`KI``Es``Es``Es`KI

Hmmm, it looks like a bit of source code and a state engine to me!

--
$Stalag99{"URL"}="http://stalag99.keenspace.com";

Replies are listed 'Best First'.
Re: Re: I refuse to explain this
by petral (Curate) on Apr 10, 2001 at 08:26 UTC
    Hmmmm, looks kinda like unlambda (the lower case, anyway).

    p
      Says petral:
      looks kinda like unlambda
      Wow, great catch!

      I had forgetten all about unlambda, and I owe you big thanks for reminding me. You are absolutely correct. You can think of this program as an interpreter for a language very similar to unlambda. In particular, the I, `, S, and K have exactly the same meaning as in unlambda.

      Now I don't have to refuse to explain the program; I can just point to the unlambda web pages. There are a bunch of variations here, but if you understand unlambda, it should be easy to understand this program. (That is something of a poisoned apple, because hardly anyone does understand unlambda.)

      Everyone should give petral a big ++ on this for being so clever.

Re: I refuse to explain this
by Dominus (Parson) on Apr 09, 2001 at 08:06 UTC
    Says strredwolf:
    The main key behind it is the use re 'eval', which allows Perl to be inside the (?{...}) considitonal regexps.
    No, that is not what use re 'eval' does; I suggest you consult the manual.

    The use re 'eval' is not really necessary to the program; it is only there to allow me to make the code simpler by abbreviating the regex.

    Hmmm, it looks like a bit of source code and a state engine to me!
    Nope, totally wrong! (Except perhaps in the trivial sense that every program is a 'state engine'.)
      I did. But I'll agree that it's helps shorten it (sub in regexp?).

      But expanding $_ out does make it look like you're doing a virtual machine inside of the s///ex regexp. Source code (or is it VM machine code?) and a state engine, like my own obfusc.

      --
      $Stalag99{"URL"}="http://stalag99.keenspace.com";

        Says strredwolf:
        But expanding $_ out does make it look like ... a state engine,
        (Shrug.) All I can do is to repeat that it isn't a state engine. In fact, I'm at something of a loss to imagine where you think the state variable is.