Part I. Beginner Concepts

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

Chapter 7

Chapter 8

Chapter 9

Chapter 10

Chapter 11

Chapter 12

In this first section, eleven articles teach you some of the corners of Perl that you won’t find in beginner books or tutorials, but are nevertheless critical bits of knowledge.

We start with two articles by Nathan Torkington. One of the first things novices learn is that Perl has three basic data structures: scalars, arrays, and hashes. Scalars are single chunks of data, such as strings or numbers. Arrays are an ordered sequence of scalars, and Nathan’s article, All About Arrays, teaches you how to manipulate them. His second article, Perfect Programming, shows you how to program defensively, demonstrating techniques for identifying mistakes and preventing them from occurring in the first place.

Next, Mark Jason Dominus’s Precedence shows how Perl’s operators “grab” the operands around them—some tightly, some loosely, and some in ways that you were never taught in grade school. After reading his article, you’ll understand exactly when you need parentheses in your expressions. Art Ramos’s The Birth of a One-Liner then shows you why Perl programs sometimes look inscrutable to the untrained eye.

Frossie Economou’s Comparators, Sorting, and Hashes shows how to use hashes (which map strings to values), demonstrating comparators and Perl’s sorting techniques along the way. Nathan Torkington continues his explanation of Perl’s syntax with What Is Truth?

Sean Burke ...

Get Computer Science & Perl Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.