Medium 9780596003128

Games, Diversions & Perl Culture: Best of the Perl Journal

Views: 593
Ratings: (0)

The Perl Journal (TPJ) did something most print journals aspire to, but few succeed. Within a remarkable short time, TPJ acquired a cult-following and became the voice of the Perl community. Every serious Perl programmer subscribed to it, and every notable Perl guru jumped at the opportunity to write for it. Back issues were swapped like trading cards. No longer in print format, TPJ remains the quintessential spirit of Perl--a publication for and by Perl programmers who see fun and beauty in an admittedly quirky little language.Games, Diversions, and Perl Culture is the third volume of The Best of the Perl Journal, compiled and re-edited by the original editor and publisher of The Perl Journal, Jon Orwant. In this series, we've taken the very best (and still relevant) articles published in TPJ over its 5 years of publication and immortalized them into three volumes.The 47 articles included in this volume are simply some of the best Perl articles ever written on the subjects of games, diversions, and the unique culture of this close-knit community, by some of the best Perl authors and coders. Games, Diversions & Perl Culture focuses on entertaining topics that make Perl users such fanatics about the language. You'll find all of the playful features TPJ offered over the years, including the Obfuscated Perl Contests, Perl Quiz Shows, humor articles, and renowned one-line recipes. The book also contains a panoply of quirky applications of Perl, including genetic algorithms, home automation, music programming, and an entire section on natural language processing.This anthology is an unmatched compendium of Perl lore.

List price: $39.99

Your Price: $31.99

You Save: 20%

 

7 Slices

Format Buy Remix

I. Culture

ePub

In this part:

Chapter2

Chapter3

Chapter4

Chapter5

Chapter6

Chapter7

In this section, six articles provide glimpses into the aesthetics of Perl. The articles touch on music, art, style, conversation, and the lifestyle of the lazy, impatient, and hubristic, in which appliances do the programmers bidding.

We begin with the first article from the first issue of TPJ: an essay by Perl creator Larry Wall that compares programming languages to music. Two sentences from his article have always resonated with me:

In trying to make programming predictable, computer scientists have mostly succeeded in making it boring.

and:

LISP has all the visual appeal of oatmeal with fingernail clippings mixed in.

Personally, I like LISP, and agree with those who think that its Scheme dialect is ideal for teaching computer science. But reading Larrys sentiments made me realize why I defected from LISP to Perl: programming languages shouldnt make everything look the same. When all code looks identical, programming becomes a matter of rote instead of a creative act of literary expression. It is that creativity that gave Perl its culture, and is what gave rise to the topics covered throughout this book, from the Obfuscated Perl contest to error messages delivered in haiku.

 

II. Science

ePub

In this part:

Chapter8

Chapter9

Chapter10

Chapter11

In this section, four articles demonstrate some scientific applications of Perl, with two hobbyist-oriented topics followed by two professional topics. John Redford begins with an article about how he designed and built a sundial for his backyard, using Perl to give it accuracy down to the minute. Brad Murray and Ken Williams follow with a tutorial on genetic algorithms in Perl, showing how to breed functions that incrementally evolve toward a desired solution.

One of the most popular articles in TPJs history was Lincoln Steins Chapter10, which chronicled how he used our favorite language to glue together disparate data formats originating in genome laboratories scattered around the globe. Astronomers Karl Glazebrook and Frossie Economou conclude the chapter with a description of the Perl Data Language, an extension to Perl optimized for manipulating large data sets such as high-resolution pictures.

 

III. Language

ePub

In this part:

Chapter12

Chapter13

Chapter14

Chapter15

Chapter16

Chapter17

Chapter18

Chapter19

Chapter20

Chapter21

Chapter22

Chapter23

Chapter24

Chapter25

Chapter26

In this section, Perl demonstrates what makes it the language of choice for manipulating language, with fifteen articles covering everything from state-of-the-art research in natural language processing and speech synthesis to practical problems like formatting text and matching names.

Natural language processinggetting a computer to understand human languageis one of those fields that seems easy at first but is actually fraught with difficulties. NLP textbooks often demonstrate the perversity of English with sentences like Colorless green ideas sleep furiously, which is grammatical but nonsensical; The horse raced past the barn left, which seems ungrammatical but isnt; and Time flies like an arrow, which is perfectly good English but has four competing interpretations.

The section begins with two articles about programs that converse: John Nolans article on a bot that dispenses psychiatric advice, and Kevin Lenzos article on the purl bot, which helps out Perl novices on Internet Relay Chat. The ever-prodigious Kevin follows up with another of the research areas that he pursues at Carnegie Mellon: open source speech synthesis in Perl.Next, Prof.Damian Conway shows you how to format text automatically with Text::Autoformat, which manipulates the indentation, quoting, bulleting, and margins of text.

 

IV. Games and Quizzes

ePub

In this part:

Chapter27

Chapter28

Chapter29

Chapter30

Chapter31

Chapter32

Chapter34

Chapter35

Chapter36

In this section, ten articles explore games that you can play and manipulate from Perl, and quizzes to test (and increase) your Perl knowledge. The first article is my survey of the world of Perl games, from ready-to-run programs to utilities that help you build your own games. I follow up with an article on the Prisoners Dilemma, one of the foundational puzzles of game theory.

Next, Michael Edmonson introduces his Rezrov interpreter for Infocom games, which allows you to control Infocoms text-based adventures from Perl.Greg Bacon then describes a graphical solitaire game implemented in Perl/Tk.

The remainder of the section consists of six Perl quiz shows. First, the four quiz shows I emceed at the OReilly Perl and Open Source conferences, followed by one that I wrote for the Perl Whirl conference/cruise. And in case those are too easy for you, the section concludes with Tom Christiansens Perl Wizards Quiz.

 

V. Poetry

ePub

In this part:

Chapter37

Chapter38

Chapter39

I received the following note from a poetry teacher as this book was zooming toward publication:

What the heck is a Perl poem? Ive been writing and teaching poetry since 1961, and I never heard of the term. Id like to know so as to see if my students and I can write perl(s).

My response:

Conventional poems are passive: they cant do anything other than sit on a page and wait for people to read them. Perl poems, on the other hand, are functional: they are active programs that a computer can execute. What the poem/program does is limited only by the poets imagination.

The most flexible computer language naturally lends itself to this most flexible linguistic endeavor. Perl poetry has been around since 1990; the original Perl poet, Sharon Hopkins, has had her work published in the Economist and Guardian.

In this section, Damian Conway discusses his Coy module, which renders error messages as haiku. Sean Burke then shows you how to use Perl to find rhymes with the proper stress and meter, and Kevin Meltzer and I conclude the section with the results of the first ever Perl Poetry Contest.

 

VI. Politics

ePub

Editors note: This article was originally written in 1996, but still applies to current elections (unfortunately).

The U.S. Presidential election once again draws near, and once again we see a contest between two men, each representing one of the two major U.S. political parties. So it goes with the two-party system.

What is it that makes the two-party system a two-party system? Its a direct consequence of plurality voting, the predominant form of balloting used in the United States where the highest vote getter wins an election. This relationship between the two-party duopoly and plurality voting is known as Duvergers Law, after the 20th century political scientist who had the guts to call it a law (Riker, 1982).

Duvergers Law has some disturbing consequences and leaves many voters dissatisfied with the status quo. Politicians will always claim to feel our pain, but at least in the U.S., two-party skeptics abound. Recent polls have shown that nearly 60% of Americans would support the formation of a new major party (Barrett, 1996).

 

VII. Obfuscated Perl

ePub

In this part:

Chapter43

Chapter44

Chapter45

Chapter46

Chapter47

Chapter48

When I began TPJ, I knew that hosting an Obfuscated Perl contest was a must. Soon after launching the magazine, Felix Gallo volunteered to author the announcements and results, and his twisted eloquence hit the mark perfectly. The contests challenged the Perl community to generate programs so contorted that the judges (Felix and I) couldnt deduce how they worked. Some of the entries were surprisingly educational and useful, most were grotesquely humorous, and a few became the firstever publication of Perls most obscure nooks and crannies.

The notion of squeezing a program into the smallest space available isnt as frivolous as it might seem. Computational theorists sometimes measure the complexity of an algorithm by how concisely it can be expressed; the briefer the program, the simpler the algorithm. Brevity can have political implications as wellconsider the old furor over the legality of exporting the RSA cryptosystem, which has been implemented in successively tinier Perl programs, culminating in this two-line obfuscated masterpiece by Adam Back and others:

 

Details

Print Book
E-Books
Slices

Format name
ePub
Encrypted
No
Sku
9781449397784
Isbn
9781449397784
File size
0 Bytes
Printing
Not Allowed
Copying
Not Allowed
Read aloud
No
Format name
ePub
Encrypted
No
Printing
Allowed
Copying
Allowed
Read aloud
Allowed
Sku
In metadata
Isbn
In metadata
File size
In metadata