28th March 1990: You are sitting at your workstation inside
the most advanced aerospace agency on Earth.
Concentrating, intensely concentrating, busy designing
the most advanced postmodern programming language on Earth.
But wait, what's that noise? A poetry reading?
In the next cubicle? You must be joking!
No ... clear as a bell, you hear:

I'd travel to the ends of time
For you, my one, my only love.
I'd force the sun to leave its track
(If you were lost) to fetch you back.
I'd suck the juices from a lime,
I'd re-write Moby Dick in rhyme,
I'd happily commit a crime,
For you my dearest darling dove.
I'd do it all, and more beside;
Now *would* you take the trash outside?

There is little doubt that the whole Perl poetry movement sparked from
this single chance event. Had Larry and gifted poet Sharon Hopkins
not been working together at JPL would Perl poetry exist today?

I know it's weird, but it does make it easier to write poetry in perl. :-)

The quotes above reaffirm Perl as the premier computer language
for writing poetry -- and indeed
perhaps the only computer language in history where the ability
to compose poems actually affected its design.

This, the fifth episode of the long running
series on the lighter side of Perl culture, focuses on
Perl Poetry.

Why is Perl a Good Language for Writing Poetry?

Look at the use of parentheses in Lisp or the use of white space
as syntax in Python. Or the mandatory use of objects in many
languages, including Java. All of these are ways of taking
freedom away from the end user 'for their own good'.
They're just versions of Orwell's Newspeak, in which
it's impossible to think bad thoughts.

Some language designers hope to enforce style through various typographical means
such as forcing (more or less) one statement per line. This is all very well for
poetry, but I don't think I want to force everyone to write poetry in Perl.

No, really, I don't want an identification division.
The problem with identification division is it really puts a crimp
in Perl's poetry, or in Cobalt poetry. How many poems can you
start off identification division? One.

The key point from the quotes above is that, in the spirit
of freedom and TMTOWTDI, Perl allows you to write poetry
without forcing you to do so.

Perhaps the primary reason why Perl is so well suited to writing
poetry is simply that it was designed, not by a computer scientist like most computer languages,
but by a linguist. Curiously, Larry attended linguistics graduate school
at U.C.Berkeley at around the same time as
Bill Joy
and his BSD cohorts attended computer science graduate school there.
As far as I'm aware, they did not write any poems together while at Berkeley.

Perl's poetry support was further strengthened by the chance
circumstance of an enthusiastic and innovative poet,
namely the reigning Perl poetry pump-queen Sharon Hopkins,
sitting right next to Larry at
JPL
during Perl's formative years. Newsgroup messages suggest
that Larry moved from JPL to netlabs in July 1991, and that Sharon
followed him there about one year later.

What Makes a Good Perl Poem?

There is little difference between a good conventional
poem and a good Perl one; it's just that the Perl poem
must satisfy an additional constraint of compiling
(and optionally running) without error.

As you might expect, it is much harder to write a Perl poem
that actually runs without error. So much so that most
Perl poets satisfy themselves with poems that merely pass
perl -c.

In 1962, the French
Oulipo
movement proposed the idea of poetry written in programming languages.
As described
here,
however, it took ten years before anyone actually did it,
the first poems being
penned by Le Lionnais and Noel Arnaud in the Algol
programming language in the early 1970s.

Though
history.perl.org
credits Larry Wall
with writing the first Perl poem in March 1990:

Sharon Hopkins and merlyn should perhaps share the glory
(or blame, depending on your point of view :-) -- merlyn for inventing
the JAPH, Sharon for suggesting that Larry write a JAPH in the
form of a haiku.
Notice that, when read aloud with canonical Perl poetic pronunciation, namely:

this poem does indeed qualify as a haiku (5-7-5 syllables).
Notice too that this Perl 3 code no longer runs with modern perls.

Sharon Hopkins hosted the first
First Perl Poetry Contest
in August 1991.
This contest was
won
by Dr. Craig Allen Counterman, Ph.D,
with a rollicking rhyme, "Time to Party".
Alas, the contest could hardly be called a success because this was
the only entry received and, by the author's own admission,
was less inspired than his more scholarly
earlier work "Ode to my Thesis".
Both of Craig's poems can be found in
Camels and Needles.

Numerous Perl poetry contests have been run since then by
Kevin Meltzer of The Perl Journal, by TPC, and by ActiveState.
There was even one run here at Perl Monks: Aaah, spring (A Very Special Perlmonks Contest).
See the References section below for links.

Around 1999, there was an explosion of interest in haiku, sparked
by TheDamian's delightful
Coy module.

Haiku and Coy

A haiku is a
short poem that's 17
syllables in length.
...
The 5-7-5
art form is widely practiced
on the Internet.
...
Damian Conway
is stuck inside a haiku
and he can't get out!

Damian Conway's prize-winning Coy module caused a sensation when it debuted in 1999.
Essentially a drop-in replacement for Carp,
the module itself is quite sophisticated, featuring an extensible
data-driven poem generator.
The entire Coy module documentation is written in haiku; here is the
module description:

Error messages
strewn across my terminal.
A vein starts to throb.
Their reproof adds the
injury of insult to
the shame of failure.
When a program dies
what you need is a moment
of serenity.
The Coy.pm
module brings tranquillity
to your debugging.
The module alters
the behaviour of die and
warn (and croak and carp).
It also provides
transcend and enlighten -- two
Zen alternatives.
Like Carp.pm,
Coy reports errors from the
caller's point-of-view.
But it prefaces
the bad news of failure with
a soothing haiku.

Look at the use of parentheses in Lisp or the use of white space as syntax in Python. Or the mandatory use of objects in many languages, including Java. All of these are ways of taking freedom away from the end user 'for their own good'. They're just versions of Orwell's Newspeak, in which it's impossible to think bad thoughts.

Not in the same way as Python. It's natural enough for whitespace to be required between certain tokens, or even all tokens. The requirements of presence or absence of whitespace isn't what Larry was addressing.

A space or tab in Python isn't just separating active tokens, it is an active token. Python actually uses the amount of whitespace between visible tokens to change the order of execution.