Perl programmer humour

Three examples of perl programmer humour I've seen in code and/or documentation. Read the comments for more examples.

At the end of a module we're all used to seeing the line:

    1;

I just noticed that parent has the following instead:

    "All your base are belong to us"

A reference to an internet meme, and parent is a lightweight replacement for the base pragma.

Another module which made me smile: the SEE ALSO section for Chart::Strip says

    Yellowstone National Park

And the documentation for Class::Singleton has example objects called $highlander and $macleod, leading to the line "There can be only one", which is taken from the film Highlander.

What others have you seen?

10 Comments

I'll often end my modules with __PACKAGE__ or __FILE__. I occasionally end them with something more amusing... e.g. Sub::Lazy.

Sub::Exporter's magic true value is "jn8:32" which is a reference to a verse about truth from the Bible: "Then you will know the truth, and the truth will set you free."

Nearly every module I've written in the past couple of years (both public and private) ends with a statement of the form, 1 && q{this statement is true};, where the stuff in the quotes is usually something random.

For example, at the end of Set::CartesianProduct::Lazy is the line, 1 && q{a set in time saves nine};. Date::Extract::Surprise has q{life without coffee isn't worth living} and another module ends with q{this is a terrible kludge}

I don't remember exactly why I use the 1 && ..., but it was either to suppress a warning I would get when using just a bare string there, or perhaps it was to satisfy a Perl::Critic policy, or maybe it was to satisfy a co-worker who felt the purpose of the bare string was confusing...

Looking through some of those, I really like the ones that are the "what I'm currently listening to". Seems like a nice hidden time capsule for many years from now. I might start doing that too or something like it.

Hm, the last run of Acme::ReturnValue was more than two years ago. Maybe I should run it again (and/or improve Acme::ReturnValue)...

And regarding the return value "favourite record of the moment", for some reasons I don't remember right now I stopped doing that some time ago. But it was in fact funny and has indeed a time capsule effect when I re-open some old file a few years later.

In Test::Database, all database "drivers" end with the name of the DBD driver. Not really funny, though.

Leave a comment

About Neil Bowers

user-pic Perl hacker since 1992.