This book is based on the learn-by-doing priNCiple because I believe that simply reading about a subject
makes it harder to learn. After all, you don't read about putting together a jigsaw puzzle; you put the puzzle
together yourself! Programming is the same way. You must actually run some programs in order to really
understand the coNCepts.
Perl 5 By Example will teach you how to use the Perl programming language by showing examples that
demonstrate the coNCepts being discussed. The examples are designed to give you a chaNCe to
experiment-which in turn should clarify the material.
Additional information and errata pages can be found at http://www.mtolive. com/pbe/index.html.
The topics are covered in a straightforward, nontechnical manner, which allows you to quickly understand
the fundamental priNCiples. After the main topic of each chapter is introduced, subtopics are explored in
their own sections. Each section has its own Perl examples with explanations given in pseudocode.
Each chapter finishes with review questions of varying difficulty based on the material in that chapter. The
answers usually come from the text or are deducible from the text, but occasionally you might need to
experiment a little. Try to answer the questions at all difficulty levels. If you get stuck turn to the answers
provided in Appendix A. Also, look at the summary sections after reading each chapter and return to them
frequently. After you've gone through several chapters, you'll begin to understand more often the reason
why a coNCept was illustrated or a question was asked. Returning to questions that frustrated you earlier
and realizing that now you know the answers can be a big confideNCe builder.
Who Should Use This Book?
Perl 5 By Example should be read by anyone seeking to learn Perl. If you don't know any other
programming languages, Chapters 2 through 7 will give you a solid introduction to the basics. If you
already know another language, then skip Chapters 2 through 7 to see how Perl differs from other
languages and start with Chapter 8, "RefereNCes."
This book follows a simple format. Each chapter contains a single topic-usually. First, you read about the
topic and then you see examples that let you work directly with Perl to understand how the coNCepts can
be applied to a program. At the end of each chapter is a summary, followed by review questions and
This approach is designed to serve a broad range of readers from novice to advaNCed. If you've never
programmed before, the learn-by-doing approach will help you move quickly and easily though this book.
If you have programming experieNCe, you'll find plenty of material to refine and enhaNCe what you
already know, and to give you a solid understanding of how Perl works.
What Do I Need?
In order to effectively use this book you need two things. You need a working copy of Perl 5. And you
need a text editor. That's it.
You can use the examples in this book with just about any hardware and operating system. I'm not sure that
they would work on an Amiga system but other than that you should be able to run every example.
How to Use This Book
There are several ways to use this book. One obvious method is to begin at the first page and proceed in
order until the last. Most beginning programmers will use this method and the book is specifically designed
so that each chapter builds on the last. Alternatively, you can read up to Chapter 10, "Regular Expressions,"
and then skip to Appendix C, "FuNCtion List." You can then read specific chapters as needed when your
projects demand them. Either approach works.