Manning Logo
Home | Ordering Info | Shopping Cart | Manage My Account | Login
Attention customers: online shopping is now available exclusively through our main website: http://www.manning.com. Thank you.
Elements of Programming with Perl

Inside the book

Sample chapters Table of Contents Errata Index Preface Book Reviews Source Code Author Online

Manning Blog

Why small is sweet?

Author Blogs

Dave Crane more...

Author Calendar

Upcoming Events

Catalog

Java .NET Perl XML All by Subject All by Title

About...

Manning Contact Us Ordering FAQs ebooks Covers Sandbox Forums Distributors Manning Early Access Program (MEAP) Affiliate Program Academia/Publicity User Group Program Press Releases Jobs

Manning Publications Co.
209 Bruce Park Avenue
Greenwich, CT 06830

Elements of Programming with Perl
Andrew L. Johnson

1999 | 368 pages
ISBN: 1884777805
$34.95 Softbound print book  

Preface

The Norse God Odin had two ravens, Hugin and Munin (Thought and Memory). He would send them out each day to fly to the corners of the earth. At night, they would return and tell him all their secrets. Odin knew how to manage his resources. Thought and memory, cogitation and recall, processing and storage--as a programmer, these are the important resources you too must tame. This book aims to be your guide in this endeavor. By the time you finish this book, you should have the skills to manage your own Hugin and Munin. In other words, you will be able to write your own hugin Perl program to scour the web for interesting information, as well as a munin program to manage and query the database of information you collect.

There are a lot of books about Perl on the market today, and some of them I recommend highly. (See Appendix C, "Additional resources.") However, many authors of these other Perl books assume readers are already familiar with programming. Other authors take the side-effect approach, teaching readers the vocabulary and syntax of the language but offering few guidelines on how to use it effectively. I do not believe that the side-effect approach is an effective means of teaching programming.

This book instead presents the basic elements of programming using the context of the Perl language. I do not assume that you've programmed before, nor do I merely hammer you with syntax and function names. This book is designed to teach you both programming and Perl, from the basics to the more advanced skills you need to become an accomplished Perl programmer.

Audience

This book is intended for two types of readers: those approaching Perl as their first programming language and those who may have learned programming off the cuff but now want a more thorough grounding in programming in general, and Perl in particular.

More people than ever are learning Perl. Undoubtedly, Perl's widespread use for Common Gateway Interface (CGI) and web-client programming contributes to its popularity. Some people need Perl skills for their jobs, while others just think Perl programming is cool. Whatever your motivation, you need to understand up front that this book is not about using Perl for web-related programming, although an example or two illustrates that application of Perl. Instead, this book is about learning how to program using Perl. Once you have that knowledge under your belt, you can apply it to a multitude of problem domains.

This book does not assume that you know what variables, arrays, and loops are, or that you've programmed before. However, familiarity with basic mathematical concepts and logic will certainly be helpful. Readers with no prior programming experience should, of course, begin at the beginning and work their way through the first nine chapters in order. Chapters 10 through 15 are largely independent and can be read in any order. Chapters 16 through 19 introduce advanced Perl concepts. Each of these chapters lays a foundation for the following chapter, so read these four chapters in order.

If you are already familiar with elementary Perl programming, you may want to read chapters 2 and 3, and then pick and choose chapters that tackle areas in which you wish to improve. For example, chapters 6, 10, and 11 cover different aspects of regular expressions and matching operators. Chapter 8 covers references.

If you are a competent programmer in another language, this book may still be useful in demonstrating Perl's way of doing things. However, the discussions may not be as concise as you'd like, and the content is not organized as a reference book.

Organization

The book is organized in four main parts, starting with things to consider before you begin programming, followed by the essential aspects of programming with Perl. The third section explores a few of the more practical and Perl-specific areas. Finally, the later chapters introduce more advanced concepts, such as abstract data structures and object oriented-programming using Perl.

Introductory elements

The three chapters in this section provide elementary information on programming and the Perl language. Chapters 2 and 3 also delve into the basics of program structure and design. In chapter 3, we work through two examples, providing a whirlwind tour of the Perl language in the process.

Essential elements

Chapters 4 through 9 cover the essential concepts and structures you need to learn to program effectively. Here you will find everything from variables to loop control constructs to file input and output to basic regular expressions to subroutines to references and nested data structures. When you finish this section of the book, you will have all the tools you need to build real-world applications.

Practical elements

Chapters 10 through 15 take you into areas more specific to the Perl language, exploiting some of Perl's unique and powerful strengths. Here we explore regular expressions in more detail, string and list processing, more input and output techniques, using modules, and the Perl debugger.

Advanced elements

Chapters 16 through 19 provide an introduction to more advanced programming techniques, including building modules and abstract data structures. You are also introduced to object-oriented programming features in Perl. Chapter 20 mentions a few areas not covered in this book and suggests references for further study.

Appendices

The four short appendices cover command-line switches, special Perl variables, additional resources for readers, and a brief explanation of binary, octal, and hexadecimal numeric representation. Following the appendices is a small glossary of technical terms used in this book.

Source code, solutions, and errata

The source code for many of the example programs and modules presented in this book may be obtained from Manning's website. Point your browser to http:// www.manning.com/Johnson for links to the online resources for the book, including source packages.

Many chapters have a small number of exercises at the end. There is no appendix of answers to these exercises. However, the web page mentioned above contains a link to a solutions page.

Finally, although we have strived to eliminate mistakes from the manuscript, some errors may have slipped through. The previously mentioned web page contains a link to an online errata listing corrections to errors discovered after the book was published. If you find any errors, please let us know so we can list them on the errata sheet and fix them in a later printing. The errata page lists an email address to which you can submit error reports.

Conventions

In this book, "Perl" (uppercase P) refers to the Perl programming language, while "perl" (lowercase p) refers to the perl compiler/interpreter or the perl distribution.

Filenames and URLs appear in italics. Code, program names, and any commands you might issue at the command line prompt appear in a fixed-width font. Some blocks of code are written using a form of literate programming (LP) syntax to break the code into smaller chunks for presentation (explained in chapters 3 and 9). In these cases, the real Perl code, or the pseudo-code, is in a plain fixed-width font, while the lines representing literate programming syntax are in an italic fixed-width font.

Many of the technical terms introduced in this book are defined in the glossary. When the terms first appear in the text, they are italicized.

You will also see the words foo and bar throughout this book. These are generic terms commonly used in syntax examples to represent the name of a variable or the contents of a string. They are used when the point of the example is not directly related to whatever is being called "foo." You might encounter these terms--and many similar "dummy" words, such as foobar, baz, qux, and quux--in publicly available articles and examples on programming.

DESCRIPTION

As the complexity of web sites grows, more and more webmasters need to acquire programming skills. Naturally, such persons are inclined to learn Perl, the "language of the web." However, there has been no book to treat Perl as the first programming language; every Perl book assumes that the reader can program already.

Until now.

Elements of Programming with Perl is a general introduction to programming, using Perl as the implementation language. It starts at the beginning, teaching programming style, structure, and design. It covers all the fundamental elements of Perl (e.g., pattern matching and text processing) and proceeds to advanced concepts, including modular programming, abstract data structures, and object oriented programming.

Elements of Programming with Perl contains numerous examples and diagrams that illustrate concepts, algorithms and techniques. Complete example programs show the new programmer how to tie concepts together to solve real-world problems.

Elements of Programming with Perl is designed for the new programmer who needs to know Perl, and for the regular Perl user who would like to improve his or her programming skills.

Translation rights for Elements of Programming with Perl have been granted for France, Germany, India and Japan. If you are interested in learning where to buy this book in a language other than English, please inquire at your local bookseller.

WHAT THE EXPERTS SAY ABOUT THIS BOOK...

"It is a very good introduction to Perl -- and programming -- for the neophyte who has never taken a programming course, or the webmaster who never learned the lessons that would be taught in one. It makes a great companion to the Llama for those who need more thorough explanations, or just like a little theory with their tools."
--Rachel Rawlings at perlmonth.com

"This book would appear to fall neatly between Learning Perl, which is targeted not only to the Perl beginner, but to the programming beginner as well, and Programming Perl, making it an ideal entry text for experienced programmers in other languages."
--Editor Arthur Corliss with Alaska Perl Mongers

"New to programming, and think Perl may be up your alley? Andrew Johnson's excellent Elements of Programming with Perl will teach you both disciplines...From the start, Johnson's explanations are clean and clear. It's obvious that he's polished his didactic style through years of real world teaching. Also from the start, good programming practices receive due emphasis...

This is a good introduction to Perl, and a very good introduction to programming in general. Johnson promotes good habits and discipline... It's a rare book that teaches as well as it informs, so take the plunge and teach yourself Perl and programming."
--chromatic, slashdot.org

"It seems quite clear that Elements of Programming with Perl is the first book that you would want to actually recommend…[which teaches Perl to non-programmers]…without worrying that they'll have to be entirely retrained afterwards. Johnson does a good job of presenting the basics. After a short introduction to both programming and Perl, the book moves immediately on to structure and style…I am quite happy to recommend this title. The book is informative and clear, and is a good introduction to basic programming and Perl."
--David Adler, Perl Mongers User Group

"Continuing to expand its very strong series of Perl books, Manning Publications has come out with Elements of Programming with Perl, a beginner's Perl text that's meant, in part, to compete with O'Reilly & Associates' Learning Perl and other standard texts of the Perl programming community. Elements of Programming with Perl communicates the basics of the language without the smarty-pants tone that the O'Reilly book slips into from time to time.

...this book provides an excellent introduction to procedural programming concepts (and the special rules of regular expressions), using Perl as a medium. It's a great book for novice and intermediate programmers."
--David Wall, The Development Exchange Enterprise Zone

WHAT THE READERS SAY ABOUT THIS BOOK...

"I learnt enough about Perl from this book to actually be productive with it, and it was enjoyable enough to encourage me to start playing with the language."
--Kelsey Gray, Perl Newbie

ABOUT THE AUTHOR...

Not only does Andrew L. Johnson hold a master's degree in anthropology, but he also has more than 15 years of experience programming in a variety of languages. As a consultant he does custom data manipulation and analysis programming for market research. He has written training materials, articles for scientific journals, and articles and reviews for the Linux Journal. He has been a regular contributor to the comp.lang.perl.misc newsgroup.

Home | Catalog | Privacy Policy | About Manning

© 2003-2006 Manning Publications Co.