#!/usr/bin/perl -s qq#$/=$x;#;#q#is a Quine statement#;qq $/='qq';$i=shift||2;open(i,$0);$i--;$f=<i>; $f.=$c=<i>;p('^.','','(..$)','','#;#',''); $p&&p(q disd,q pis notp);$s='"\n",eval $c,' .(('&j,eval $c,')x$i).'&a';$d&&eval$c||print reverse (eval $s);$f.=<i>;$d&&&h; sub j {p('#.$','" #');''} sub a {'"' x$i} sub p {@_?(eval'$c=~s/'.(shift).'/'.(shift).'/')&&p(@_):0} sub h {print $f}
This was done at the 4th German Perl Workshop. They didn't managed to put anything on the conference bags, so they gave out plain bags and special markers and started a "onebagger" competition. I wrote this on the backside, and '{picture of a camel} is not a camel' on the front (there had to be a camel on the bag).

UPDATE: Pictures available now, thanks to Marc Lehmann:
Front
Back

My bag even got a price (but then, only three bags were submitted, and there were three prices ...)!

So, what is this?

This obfu was inspired by TheDamians talk (which was great) about SelfGOL (whis is sick & great). Call the script with a number as an argument, and it prints the specified levels of correctly quoted Quine statements. Call it with -p and it is in 'paradox mode'. Call it with -d and it dumps the source (in case you don't have 'cat' nearby).

The script isn't obfuscated very much (I didn't apply any of those tricks to hide the code completly), but you can't deparse it with perl -MO=Deparse (that is, if you run Deparse on it, and then run the output as a script, it won't work)

BTW, the japh-subnames are there just for fun, could be anything, but then, TMTOWT print japh


In reply to A self-replicating Quine-Statement generator with an optional 'paradox' mode by domm

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.