UKUUG home


(the UK's Unix & Open Systems User Group)






Book Discounts

Other Discounts

Mailing lists






Learning Perl - 4th Edition Randal L. Schwartz Tom Phoenix and brian d foy
Published by O'Reilly Media
704 pages
£ 28.50
Published: 22nd July 2005
reviewed by Greg Matthews
   in the September 2005 issue (pdf), (html)

A few years ago I was given the task of maintaining and improving a bunch of in-house scripts written in Perl and was given the first edition copy of ``Learning Perl'' (the Llama) along with ``Programming Perl'' (the camel) and told to get on with it. I never seemed to have the time to devote to really studying this language and everything that I have learned is the result of having to fix someone else's code or bolting on extra functionality to an existing tool.

Initially, the fourth edition of the Llama doesn't seem that different to the first, but further investigation shows that a lot of thought has gone into the progression of the book and its topics, the subject matter of the chapters is much more clearly delineated. It no longer plunges into multi-page scripts in the Introduction.

Early chapters are concerned with introducing Perl as a language and an interpreter, getting the reader used to the perl vocabulary of scalars, arrays and hashes. Then on to meatier topics of subroutines and I/O. All new material is exemplified with code snippets and each chapter ends with a handful of exercises (reflecting the materials origins as course notes). Chapter 6 introduces ``hashes'' (these used to be called associative arrays but as they were so useful and used so much, the perl developers decided they needed a shorter name to lessen the risk of RSI) and then we are on to three whole chapters devoted to regular expressions. Perl and regular expressions are inseparable so it's great to see them covered in detail. Some people may think they look like line noise but in fact regular expressions are not very difficult, and although I am not fluent, I know that they are logically constructed and if I quell the rising sense of panic at seeing something like:

I can start at the beginning and apply the rules of regular expressions and work out exactly what it means. Learning how to read and use regular expressions will stand you in good stead in all sorts of situations. As Perl's great strengths are in parsing, manipulating and reporting data it makes perfect sense to devote 34 pages of the book to deal with this topic.

Next we are introduced to more control structures, these are standard toolbox commands such as conditionals, incrementers and loops which are many and varied. Interestingly, at the end of this chapter, the exercise is one that appeared as an example in the Introduction of the first edition -- 10 chapters into the fourth edition! More chapters deal with file and directory handling.

Further information follows on process management and even brief sections on forking and signal handling -- I would have like more on these topics but each of these requires a more in-depth analysis and there is no shortage of information available for anyone who has graduated past the scope of ``Learning Perl''; Appendix B ``Beyond the Llama'' is 20 pages of references to more detailed information. Its worth noting from this, that a vast amount of documentation is included with standard installations of perl; a quick man perl will get you going, or perldoc perltoc.

This is expected to be the last Llama book published before the release of Perl v6 but Perl v6 is hardly mentioned, new users of Perl would be interested to know of future developments. My main concern was the lack of coverage for CPAN, the online Perl archive, absolutely crucial to anyone writing Perl code. This edition doesn't have Larry Wall's original foreword but it continues the tradition of copious footnotes, most of which are either exceptions to the rules -- which are many -- or bad jokes. The style is light and open which is no mean feat for a language that has competitions for obfuscated code. This book can be summed up as a solid introduction to Perl v5.8. There's no quick way to learn a language but finding time to work through this book will put you in good stead. Anyone past the basics of the language would be better off splashing out on ``Perl Cookbook'' or ``Learning Perl''.

Back to reviews list

Tel: 01763 273 475
Fax: 01763 273 255
Web: Webmaster
Queries: Ask Here
Join UKUUG Today!

UKUUG Secretariat
More information

Page last modified 02 Apr 2007
Copyright © 1995-2011 UKUUG Ltd.