I personally believe that Perl is already known to have a fun side of its community culture, as opposed to its natural pragmatic nature and as exemplified by games like golf and ob-fu, although:

Whatever, in my Insane™ ;) wanderings through "Saint Wikipedia" I just stumbled upon the surrealist movement's game of Exquisite Corpse which, to put it as briefly as possible consists of the literary composition of texts by many persons each of which will only see the last line of what the previous one wrote or be given a basic syntactic structure to start with his or her part. Alternatively, the same term describes the corresponding graphical game in which each individual in turn draws one piece of a bigger figure folding the paper so that only a minimal portion of it will be visible.

Now, I had the Insane™ ;) idea of doing the same in Perl: of course some more care than with a generic natural language should be taken to link one piece of the program to the other. Also: should each "piece" work as of its own? I don't think it necessarily should, or it would be too restrictive wrt the surrealist POV which is the common background under which one would possibly want to play this game.


For the moment I propose that one would either give:

(As far as the second point is concerned, it means that a player may "substitute" the nth occurrence of a variable with... whatever he likes, in the spirit of the game.)

So does somebody want to (try to - it's an experiment, after all!) play with me? From a minimal snippet of code of mine to remember how "to do something" with comments removed - running under strict,warnings and 5.010 - one unclosed curly:

C:\temp>wc corpse.pl 14 33 266 corpse.pl C:\temp>md5sum corpse.pl 6c2e30cce43e0cc641decdcc129ac9d9 *corpse.pl C:\temp>tail -n 3 corpse.pl tr/\\//d, s/$bs;/\\/g for $key;

Update: one monk (whose name I will substitute to this anonymous mention if he likes to) sent me a /msg saying:

I personally believe that your starting code is rather unfortunate - it's hard to think of a program that does something useful and does a substitution in the last line without using its result... maybe pick something simpler for a start?

(additional emphasis by me)

I have two considerations to make in reply:

--
If you can't understand the incipit, then please check the IPB Campaign.

In reply to [Fun] Exquisite Corpse in Perl? by blazar

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.