I love Perl. Having used a lot of programming languages, I find Perl to be the best tool whenever I need to parse yet-another-ugly-file, grab some data from the web page, convert a bunch of files between markups, quickly hack a HTML report based on database data, or script around some text based protocol - and more. I also tend to write Perl scripts instead of shell scripts, they are more powerful and less error-prone.
The Perl strengths lie mainly in very well integrated regular expression support (resulting in compact and easy to write text parsing code), support for dynamically created complicated data structures (a list of dictionaries containing field id and items, where items is a list of numbers... can be trivially created and operated) and CPAN - giantic library of useful libraries.
As I plan to refer to Perl in some future articles, I decided to save here a few valuable pointers:
-
the best book to learn Perl from scratch: Learning Perl - concise, well written, and containing many useful examples
-
awesome set of real-life examples and solutions: Perl Cookbook
Those two books should be sufficient for most people. Some possible extras:
-
explanation of language inner working and descriptions of concepts and APIs needed to embed or extend Perl: Advanced Perl Programming by Sriram Srinivasan (do not confuse it with another O'Reilly book of the same title, by Simon Cozens, also interesting but about totally different subject)
-
very good introduction to regular expressions: Mastering Regular Expressions (this book is not language related, applies to all popular regexp implementations)
-
description how to access databases from Perl: Programming the Perl DBI.