Black Perl

Revision as of 16:12, 26 June 2024 by imported>OAbot (Open access bot: doi updated in citation with #oabot.)
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Template:Short description Template:Distinguish "Black Perl" is a code poem written using the Perl programming language. It was posted anonymously to Usenet on April 1, 1990,<ref name=":0" /> and is popular among Perl programmersTemplate:Citation needed as a piece of Perl poetry. Written in Perl 3, the poem is able to be executed as a program.

"Black Perl" has been discussed in several scholarly works,<ref>Template:Cite thesisTemplate:Pn</ref><ref>Template:Cite book</ref><ref>Template:Cite journal</ref> and is considered an example of generative literature, a genre of electronic literature.

AttributionEdit

When posted to the comp.lang.perl newsgroup the poem was attributed to "a person who wishes to remain anonymous".<ref name=":0">Template:Cite book</ref> Sharon Rauenzahn (née Hopkins), another Perl poet, has been suspected to be the author but has since denied the claim.<ref>Template:Cite newsgroup</ref>

Result of program executionEdit

When executed, "Black Perl" exits on line one, upon reaching the function exit. The remaining lines are parsed by the Perl interpreter but never actually executed. The program produces no output.

Though it will not parse under Perl 5, multiple independent updates to "Black Perl" to make it parsable in Perl 5 have been published.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

"Black Perl"Edit

<syntaxhighlight lang="perl"> BEFOREHAND: close door, each window & exit; wait until time.

   open spellbook, study, read (scan, select, tell us);

write it, print the hex while each watches,

   reverse its length, write again;
   kill spiders, pop them, chop, split, kill them.
       unlink arms, shift, wait & 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 the 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) & warn your next victim;

AFTERWORDS: tell nobody.

   wait, wait until time;
   wait until next year, next decade;
       sleep, sleep, die yourself,
       die at last

</syntaxhighlight>

See alsoEdit

ReferencesEdit

Template:Reflist