Beginning Perl
Article Index
Beginning Perl
Going further

 Author: Curtis “Ovid” Poe
Publisher: Wrox
Pages: 744
ISBN: 978-1118013847
Audience: Non programmers and programmers experienced in other languages wanting to learn Perl
Rating: 5
Reviewer: Nikos Vaggalis

Chapters 4 to 8 examine the fundamental building blocks of the language, namely functions, references, subroutines,control flow and regular expressions, yes, they are considered a core component of the language. Ovid covers the modern style of Perl and best practices such as using strict, warnings, diagnostics or even:

".....don’t use camelCaseWords. Instead, we use words_separated_by_underscores. This is because the latter is easier to read, particularly for those who do not speak English as a first language".

However, it does not forego mentioning the "old-school" style, for example when opening a file:

"The first syntax above is referred to as the “three argument open” and the second is the “two argument open”. The second is an older version of open() and it’s generally frowned upon today, but we’ll explain it just a bit so you can understand it if you see it in legacy code (if someone is still writing using the two argument open today, it’s either because they must support a version of Perl prior to version 5.6 or they don’t know any better)"

so it provides a complete perspective of the language.

Of course, whenever applicable, the user is warned about potential gotchas arising from Perl's loose but flexible rules:

"Note that we have parentheses around the variables we’re assigning the subroutine arguments to. This is just normal Perl syntax for force list context. Here’s a common mistake many Perl beginners make:

sub random_die_roll {
   my $number_of_sides = @_;
  
# ... more code

}

That evaluates the @_ array in scalar context, setting $number_of_sides to the number of elements in @_. That’s probably not what you wanted."

Theory is put into practice through useful code examples, and additionally at the end of each chapter, there is a set of exercises for the reader to complete. The exercises start easy but gradually build up to the point of developing a full fledged web application for fighting DMCA takedown notices!

Chapter 9 covers file handling and general I/O while Chapter 10 covers the sort, map and grep operators. These operators are treated with awe, which probably arises from that they are considered responsible for a large part of Perl's idiomatic behavior, TMTOWTDI, flexibility and mix and match ability. Beware, anyone who masters their dark powers, like the Schwartzian Transform,is accused of Wizardry….

Chapters 11 covers Packages and Modules, prerequisites for jumping into the Object Oriented Programming chapters: Chapter 12: Object Oriented Perl and Chapter 13:Moose. It again begins with the basics, i.e what an object is, and looks at OOP from Perl's minimal perspective, which will surprise you if you are used to the classic OO paradigm from other static languages like Java or C# . If that is the case, then the Moose chapter will look more familiar and easier to follow. On the other side, if you are a newbie then it might serve as a good starting point to the object world. Anyway, Moose is the recommended way of doing OO in Perl nowadays, but you cannot escape the past...

The next chapters contain the material you should be focusing to for propelling your career, mainly Testing in Chapter 14, Interwebs (Chapter 15) and Databases (Chapter 16). The Interwebs chapter starts off at an elementary level with what the HTTP protocol is and gradually progresses into building a web site by means of Plack. It is a thorough example comprising HTTP requests, cookies, parameters, sessions and anything else needed. The same goes for the Databases chapter, which starts with what a database is and again gradually progresses into using DBI and working with SQLite. Catalyst,DBI:Class ORM and Template::Toolkit are covered in the last chapter, Chapter 19: The Next Steps.

Chapter 17: Plays Well With Others mostly talks about the command line, reading input or writing/piping to and from other programs, while Chapter 18 is about completing common tasks frequently encountered in the workplace such as working with CSV Data, reading and writing XML or parsing and manipulating dates.

 

In the end I think that the author delivers what he set out to do. The book is written in  non-intimidating language, free of techno-babble, and smoothly advances the beginner from writing 'scripts' to OOP and Web frameworks.

Ovid infuses the material with his confidence, leaving the reader with the "that guy knows what he is talking about" impression. This becomes even more noteworthy, when you consider that those who excel technically are not necessarily the best at communicating their expertise to the reader.

Lastly, I want to emphasize the value of Ovid's advice, diffused all over the book, drawn on more than a decade of field experience. Heck, I'd get the book based just on that alone.

Related Articles

In Praise of Perl and the Llama

Other Perl language articles

Other Perl book reviews

 

Banner


Geometrical Vectors

Author: Gabriel Weinreich
Publisher: University of Chicago Press
Pages: 126
ISBN: 978-0226890487
Print: 0226890481
Kindle: B01EYG40HO
Audience: Mathematicians, physicists and engineers.
Rating: 5
Reviewer: Mike James
Geometrical Vectors - are there any other kind?



Continuous Architecture In Practice (Addison-Wesley)

Author: Murat Erder, Pierre Pureur and Eoin Woods
Publisher: Addison-Wesley
Pages: 352
ISBN: 978-0136523567
Print: 0136523560
Kindle: ‎B08ZRTQGLJ
Audience: Software Architects
Rating: 3
Reviewer: Kay Ewbank

This book sets out the case for why software architecture is more important than ever, and in p [ ... ]


More Reviews

 



Last Updated ( Thursday, 02 May 2013 )