Beginning Perl Lesson 1

Table of Contents

Perl documentation


Terminal window

In the terminal window, use the perldoc command to view the Perl documentation. Start with the command:

> perldoc perl

The documentation is divided into many sections. For Perl 5.8.7, these sections are:

Section Description
perl Perl overview
perlintro Perl introduction for beginners
perltoc Perl documentation table of contents
Section Description
perlreftut Perl references short introduction
perldsc Perl data structures intro
perllol Perl data structures: arrays of arrays
perlrequick Perl regular expressions quick start
perlretut Perl regular expressions tutorial
perlboot Perl OO tutorial for beginners
perltoot Perl OO tutorial, part 1
perltooc Perl OO tutorial, part 2
perlbot Perl OO tricks and examples
perlstyle Perl style guide
perlcheat Perl cheat sheet
perltrap Perl traps for the unwary
perldebtut Perl debugging tutorial
perlfaq Perl frequently asked questions
perlfaq1 General Questions About Perl
perlfaq2 Obtaining and Learning about Perl
perlfaq3 Programming Tools
perlfaq4 Data Manipulation
perlfaq5 Files and Formats
perlfaq6 Regexes
perlfaq7 Perl Language Issues
perlfaq8 System Interaction
perlfaq9 Networking
Reference Manual
Section Description
perlsyn Perl syntax
perldata Perl data structures
perlop Perl operators and precedence
perlsub Perl subroutines
perlfunc Perl built-in functions
perlopentut Perl open() tutorial
perlpacktut Perl pack() and unpack() tutorial
perlpod Perl plain old documentation
perlpodspec Perl plain old documentation format specification
perlrun Perl execution and options
perldiag Perl diagnostic messages
perllexwarn Perl warnings and their control
perldebug Perl debugging
perlvar Perl predefined variables
perlre Perl regular expressions, the rest of the story
perlreref Perl regular expressions quick reference
perlref Perl references, the rest of the story
perlform Perl formats
perlobj Perl objects
perltie Perl objects hidden behind simple variables
perldbmfilter Perl DBM filters
perlipc Perl interprocess communication
perlfork Perl fork() information
perlnumber Perl number semantics
perlthrtut Perl threads tutorial
perlothrtut Old Perl threads tutorial
perlport Perl portability guide
perllocale Perl locale support
perluniintro Perl Unicode introduction
perlunicode Perl Unicode support
perlebcdic Considerations for running Perl on EBCDIC platforms
perlsec Perl security
perlmod Perl modules: how they work
perlmodlib Perl modules: how to write and use
perlmodstyle Perl modules: how to write modules with style
perlmodinstall Perl modules: how to install from CPAN
perlnewmod Perl modules: preparing a new module for distribution
perlutil utilities packaged with the Perl distribution
perlcompile Perl compiler suite intro
perlfilter Perl source filters
Internals and C Language Interface
Section Description
perlembed Perl ways to embed perl in your C or C++ application
perldebguts Perl debugging guts and tips
perlxstut Perl XS tutorial
perlxs Perl XS application programming interface
perlclib Internal replacements for standard C library functions
perlguts Perl internal functions for those doing extensions
perlcall Perl calling conventions from C
perlapi Perl API listing (autogenerated)
perlintern Perl internal functions (autogenerated)
perliol C API for Perl’s implementation of IO in Layers
perlapio Perl internal IO abstraction interface
perlhack Perl hackers guide
Section Description
perlbook Perl book information
perltodo Perl things to do
perldoc Look up Perl documentation in Pod format
perlhist Perl history records
perldelta Perl changes since previous version
perlartistic Perl Artistic License
perlgpl GNU General Public License

Perl books

There are a lot of good books about Perl. Here is a list of books I recommend in the order that you should acquire them. The Perl novice should buy the first two books immediately.

Perl Books
Cover Publisher’s information Comments
Cover of Learning Perl, 4th Edition Learning Perl, 4th Edition
by Randal L. Schwartz, Tom Phoenix, and brian d foy
July 2005
ISBN 0-596-10105-8
O’Reilly Media, Inc.
I used the third edition book as a reference when I wrote this tutorial. This is a good book for the Perl novice.
Cover of Perl Cookbook, 2nd Edition Perl Cookbook, 2nd Edition
by Tom Christiansen and Nathan Torkington
August 2003
ISBN 0-596-00313-7
O’Reilly Media, Inc.
Your Perl problem has probably been solved before, and this is the first place to look for a solution. This is an essential resource.
Cover of Programming Perl, 3rd Edition Programming Perl, 3rd Edition
by Tom Christiansen, Larry Wall, and Jon Orwant
July 2000
ISBN 0-596-00027-8
O’Reilly Media, Inc.
This is the ultimate authority on Perl. I find this book useful as a reference, but you won’t be able to learn how to code in Perl by reading this book. Some of the witty comments in previous editions have disappeared from the 3rd edition.
Cover of Intermediate Perl Intermediate Perl
by Randal L. Schwartz, brian d foy, and Tom Phoenix
March 2006
ISBN 0-596-10206-2
OReilly Media, Inc.

Intermediate Perl is the new edition of what was formerly named Learning Perl Objects, References, and Modules, by Randal L. Schwartz.

This book picks up where Learning Perl, 4th Edition leaves off, covering eval, modules, references, complex data structures, subroutine references, filehandle references, objects, writing a distribution, and testing.

Book cover CGI Programming with Perl, 2nd Edition
by Shishir Gundavaram, Scott Guelich, and Gunther Birznieks
July 2000
ISBN 1-56592-419-3
O’Reilly & Associates, Inc.

This book is essential for anyone using Perl for CGI programming.

Book cover Object Oriented Perl
by Damian Conway
August 1999
ISBN 1-884777-79-1

This is my favorite Perl book, and this book made it easy for me to switch to object oriented Perl, which I use exclusively these days. You will not need all the information in this book, but all of the information is useful. Chapter 2, a Perl refresher, clearly explains many Perl obscurities, and this chapter is worth the price of the entire book.

This book is now out of print, but it’s available from the Manning Publications Co. web site as a PDF ebook.

Book cover Programming the Perl DBI
by Alligator Descartes and Tim Bunce
February 2000
ISBN 1-56592-699-4
O’Reilly & Associates, Inc.

This is the essential guide to using Perl to interact with databases, Excel spreadsheets, DBM files, etc. A weakness of the book is that there aren’t enough examples.

Cover of Advanced Perl Programming, 2nd Edition Advanced Perl Programming, 2nd Edition
by Simon Cozens
June 2005
ISBN 0-596-00456-7
O’Reilly Media, Inc.

This book covers advanced Perl techniques in detail. It is appropriate for someone who has several years’ experience with Perl and is creating production-quality software. I mention it here as a book for you to keep in mind as you develop your Perl skills.

Homework assignment

Find or install Perl on your computer. Find out what version of Perl is running on your computer. Find the Perl documentation on your computer.