Mastering Perl by Brian D. Foy
This is the third in O'Reilly's series of landmark Perl tutorials, which started with Learning Perl, the bestselling introduction that taught you the basics of Perl syntax, and Intermediate Perl, which taught you how to create re-usable Perl software. Mastering Perl pulls everything together to show you how to bend Perl to your will. Assuming you're familiar with concepts from the first two books - such as basic syntax, nested data structures, and the use of modules - Mastering Perl provides the next logical stage of Perl expertise by conveying its models and programming idioms. This book isn't a collection of clever tricks, but a way of thinking about Perl programming so you can integrate the real-life problems of debugging, maintenance, configuration, and other tasks you encounter as a working programmer. The book explains how to: use advanced regular expressions, including global matches, lookarounds, readable regexes, and regex debugging; avoid common programing problems with secure programming techniques; debug Perl with the Perl debugger, write your own debugger, and use debuggers others wrote; profile Perl to find out where you should concentrate your efforts before setting out to improve your program; benchmark Perl to figure out which implementations do better on time, memory, and other metrics - and cautions about what your numbers actually mean; wrangle Perl code to make it more presentable and readable by using M or M; symbol tables and typeglobs - How Perl keeps track of package variables and how you can use that mechanism for some powerful Perl tricks; define subroutines on the fly and turn the tables on normal procedural programming; and iterate through subroutine lists rather than data to make your code more effective and easy to maintain. It also includes topics such as: modify and jury rig modules to fix code without editing the original source; let your users configure your programs without touching the code; detect and reporting errors by learning how Perl reports errors, how you can detect errors Perl doesn't report, and how to tell your users about them; let your Perl program talk back to you by using Log4perl; store data for later use in another program, a later run of the same program, or to send as text over a network; work with Pod to translate plain ol' documentation into any format that you like, and test it, too; use bit operations and bit vectors to efficiently store large data; implement your own versions of Perl's basic data types to perform fancy operations without getting in the user's way; and write programs as modules to get all of the benefit of Perl's module distribution, installation, and testing tools. The appendices include Brian's Guide to Solving Any Perl Problem to improve your troubleshooting skills, as well as suggested reading to continue your Perl education. Mastering Perl starts you on your path to becoming the person with the answers, and, failing that, the person who knows how to find the answers or discover the problem.