Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
No such thing as a small change
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I suppose someone has probably already done this, but my attempt to find it in SuperSearch failed, so here goes. I have adapted Black Perl so that it compiles in Perl 5. It astonished me how few changes were necessary, and how little they disrupted the mood.

I didn't do this because I like Black Perl (the first time I read it, I thought, "how perverse"), but more because, having read that it would not compile in Perl 5, I felt... challenged. Though in retrospect, it wasn't much of a challenge. Still, here it is...

# Black Perl, adapted for Perl 5 by Jonadab. # Adapted from Black Perl, as seen in the Camel, # 2nd ed., p 553 BEFOREHAND: close door, each window & exit; wait until time; open spell book; study; read (spell, $scan, select); tell us; write it, print the hex while each watches, reverse length, write again; kill spiders, pop them, chop, split, kill them. unlink arms, shift, wait and listen (listening, wait). sort the flock (then, warn "the goats", kill "the sheep"); kill them, dump qualms, shift moralities, values aside, each one; die sheep; die (to, reverse the => system you accept (reject, respect)); next step, kill next sacrifice, each sacrifice, wait, redo ritual until "all the spirits are pleased"; do it ("as they say"). do it(*everyone***must***participate***in***forbidden**s*e*x*). return last victim; package body; exit crypt (time, times & "half a time") & close it. select (quickly) and warn next victim; AFTERWARDS: tell nobody. wait, wait until time; wait until next year, next decade; sleep, sleep, die yourself, die @last

So now it compiles in Perl 5 (tested with 5.6.1), but it still doesn't do anything useful. (I think I'm glad.) I suppose, having taken this step, it is inevitable that someone will also port it to Perl 6, in time. As an interesting side note, if you change $scan back to scan (as in the original) it compiles but dumps core. Maybe I should have left it that way.


sub H{$_=shift;while($_){$c=0;while(s/^2//){$c++;}s/^4//;$ v.=(' ','|','_',"\n",'\\','/')[$c]}$v}sub A{$_=shift;while ($_){$d=hex chop;for(1..4){$pl.=($d%2)?4:2;$d>>=1}}$pl}$H= "16f6da116f6db14b4b0906c4f324";print H(A($H)) # -- jonadab

In reply to Black Perl updated for Perl 5 by jonadab

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (10)
    As of 2014-04-21 08:24 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (492 votes), past polls