What will you find here?

This site is devoted to spreading the Perl meme and to providing an easy place to find complete, working examples of good Perl code. In the process of using this site, we hope that we help you to become better equipped to use Perl and to evaluate language choices critically.

We hope we can convey some of the power and fun we get out of working with Perl and some insights into how Perl developers think.

We hope you'll find some of these ideas infectious. ;-)

Other resources

If you're completely new to Perl, make sure you also check out learn.perl.org

The FAQ section

The FAQ section answers frequently asked questions about Perl. Most of the problems addressed here (and the corresponding code samples) are very small.

The focus of this section is problem-solving. Solutions are geared toward the problem at hand, rather than exploring Perl functionality in elaborate detail.

Examples found in the FAQ section include:

  • How do I initialize multiple variables in one statement?
  • How do I remove a newline from the end of a string?
  • Can I make changes to a file without using a temporary file?
  • How do I break out of a loop?

The HOWTO section

The HOWTO section provides more elaborate explanations of how to use various parts of Perl.

The focus of this section is providing in-depth coverage of a part of Perl. Solutions are provided that illustrate the element of Perl under consideration, rather than being written in the language of the problem itself.

Examples found in the HOWTO section include:

  • How do I use the Perl split() function?
  • How do I use the Perl sort() function?
  • How do I compare values in Perl?
  • How to use the Perl if, elsif, else statement?

The TUTORIAL section

The TUTORIALs section provides fully worked examples relating to a class of problem.

Examples found in the TUTORIAL section include:

  • Connecting to a database
  • Sorting in Perl
  • Creating a simple cgi script
  • Creating a simple web form
  • Creating a web form to upload files
  • Parsing HTML with HTML::Parser
  • Parsing CSV files
  • Automating testing with Test::More

Mailing lists

For a low volume mailing list announcing changes to this site and new content, etc, subscribe to the perlmeme.org announcements list, or visit the archives here

Want to help build the site? Subscribe to the perlmeme.org developer's list which is archived here

What is a meme?

A meme is sometimes defined as the unit of cultural evolution, in the same way that a gene is the basic unit of biological inheritance. The term was invented by Richard Dawkins in his 1976 book The Selfish Gene
Examples of memes are tunes, ideas, catch-phrases, clothes fashions, ways of making pots or of building arches. Just as genes propogate themselves in the gene pool by leaping from body to body via sperms or eggs, so memes propogate themselves in the meme pool by leaping from brain to brain via a process which, in the broad sense, can be called imitation. If a scientist hears or reads about a good idea, he passes it on to his colleagues and students. He mentions it in his articles and his lectures. If the idea catches on, it can be said to propagate itself, spreading from brain to brain.
Dawkins, p 192

How does this apply to computer languages?

The idea that any programming language is more, (or less), suitable for a task than any other is a meme.

From time to time the hype surrounding the latest 'hit' language, seems overwhelming, but the waxing and waning of these languages is better understood in terms of memes.

All the community-developed langages like Perl, PHP, Python etc have a tremendous advantage over languages that are owned by a single corporation in that their capacity for evolutionary change is much greater.

What is the Perl meme?

It's lots of ideas that together define why Perl is so different.

It is the idea that there should be "more that one way to do it", the idea that a language should make easy jobs easy and hard jobs possible, the idea that laziness, patience and hubris are virtues (for a programer).

Perl itself is evolving at a rate unlike any other programming language. Those of us who use it for a living are excited by how powerful and expressive the language is and how close to the 'problem set' it is. With the development of Perl 6 well underway, the language is set to expand and take on even more functionality not found anywhere else. In our opinion, this makes it the language of choice for solving many of the software problems of the future.