So, it looks good. First pass, can't parse. Fine. perl -MO=Deparse doesn't help either. So I try a new trick from a fellow monk (instead of performing the intermediary steps manually):

$ sed s/eval/print/ zshzn.pl | perl

which yields:

open$:,shift;$/=undef;$_=<$:>;><+-.,cd;s!(.)!$1 !g;s!((?:<\s) {2,})!'$ +b-='.(length($1)/2).";"!gex;s!((?:>\s) {2,})!'$b+='.(length($1)/2)."; +"!gex;s!((?:\+\s){2,})!'$a[$b]+='.(length($1)/2).";"!ge;s!((?:\-\s){2 +,})!'$a[$b]-='.(length($1)/2).";"!ge;s!>\s !\$b++;!gx;s!<\s !\$b--;!g +x;s!([+-])\s!\$a[\$b]$1$1;\n!g;s!\.\s!print chr(\$a[\$b]);!g;s!,\s !\ +$a[\$b]=ord(substr(<>,0,1));!gx;s!\[\s!while(\$a[\$b]){!g;s!(?<=\s)\] +\s!}!g;print;

Now, I don't particularly feel like formatting all that by hand, so I:

$ s/eval/print/ | perl | perl -MO=Deparse

which yields:

syntax error at - line 1, near ";>" - had compilation errors.

So I fail challenge #1.

So I try the following:

$ perl zshzn.pl $ perl zshzn.pl file.txt $ cat file.txt | perl zshzn.pl $ perl zshzn.pl 10

All of which do nothing.

So the answer to #1 changes to: you're just doing an expensive noop that compiles cleanly the first time around. You produce no output by default, or when given input by a number of means. So I think that makes the answer to #2: the mistake in the implementation is that you've forgotten to do anything!!! :-)

So as far as what this member of the monastery thinks, it reminds of the dirty joke about the man who goes to the doctor looking awful but feeling great... But in this case, the appearance is quite titillating, but serves no useful practical purpose to me, which almost makes me expect to see another obfuscation, equally as appealing, abreast this one.



--chargrill
$,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}

In reply to Re: Eval Squared by chargrill
in thread Eval Squared by zshzn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.