Perl – Tblitw!

I love Perl! It’s the mutt’s nuts for making useful programs really quickly and s certainly a great tool for almost anything. It was first created by a guy called Larry Wall who is a bit of a hippy/God botherer. Other than that, he must be a totally top bloke because he released the source code to the general public. Since then, it has been re-written, improved and expanded many times.

Don’t quote me on this (someone else said it) but for many years Perl was the duck tape of the world wide web. Most CGI scripts were written at least in part in Perl. Another top bloke in the world of Perl and bioinformatics is Lincoln Stein. He has written quite a few Perl modules (chunks of code you can plug into your own programs so you don’t have to re-invent very common wheel-like code), one of Dr Steins modules is the CGI module itself. This module makes it really easy to write programs that you interact with through a web browser. Most forms on webpages send there information to a Perl script, the script can then process the info and generate some more HTML output as appropriate.

Installing the Perl interpreter…

There are a few scripts on this site that you can download and use, but only if you have perl installed on your local machine. If you are using Windows, go to the Activestate Download page and save the installer file somewhere you will be able to find it. Run the installer file (following the instructions) and you are ready to go. If you are using a Unix box, you should already have Perl installed.

To Check what version of Perl you have, open a command line console (the Ms-Dos prompt if you are on a Windows box). Type perl -v and you should get some text telling you about your version. If that doesn’t work, try perl perl-v.

Other Perl information…

If you want to write perl programs yourself then you should get a book. If you are a total beginner then Learning Perl by Schwartz and Christiansen is a really good place to start. You should also have a look at CPAN which is a big database of Perl modules that many people have contributed. The other great thing about Perl is that there is a big community of mostly nice geeks. There are lots of websites devoted to Perl people helping other Perl people. Personally, I like to peruse the London Perl Mongers site. The homepage was once translated in to Esparanto, but don’t be put off by that.

Downloads…

The following are some scripts I have written. They are tiny little text files that have been zipped up. If you have Perl installed, you can save and unpack these zip files, read the instructions in the README file and run ‘em! Good luck…

Photproc.pl is a script that reads a directory of images and makes an html page to display themFrac A few scripts that plot fractal images of the mandlebrot set

Leave a Reply

You must be logged in to post a comment.