Friday, 12 December 2008

Learning Perl

I'm currently reading the book 'Learning Perl' and I have to say its a really well written book. It teaches the Perl language superbly and the exercises at the end of each chapter are detailed enough to give you a chance to try out the concepts learned in the chapter while at the same time being succinct enough to keep the reader interested.

As far as Perl is concerned, I think I may have found my newest scripting language. For someone that does most of their programming in Java and having only tried Ruby briefly, Perl comes as a revelation. That a language can be so optimized, to enable the programmer to translate his thoughts as quickly as possible into code is a powerful concept.

I originally started learning Perl as a part of a project at work. We have to make a program to parse an email and classify it as a 'bounce' or a legitimate reply. Stephen, the guy I work with, wrote a parser from scratch in PHP. I'm hoping to make use of one of the Perl modules available, such as the 'Email' module I found after a quick google search.

The other project I was hoping to make use of Perl for was on my home file server. I have a lot of music files on there and I have a suspicion that a lot of space is wasted because of duplicates. I was thinking of writing a program to scan a directory and make a simple database of every file and its MD5 hash. Then comparing these hashes and giving a report on the suspected duplicate files. This seems like the kind of job that Perl would be perfect for.