Learning Perl 2nd Ed.

Randal L. Schwartz, Tom Christiansen

Publisher: O'Reilly, 1997, 271 pages

ISBN: 1-56592-284-0

Keywords: Perl

Last modified: March 21, 2022, 4:56 p.m.

In this update of the original bestseller, two leading Perl trainers teach you to use the most universal scripting language in the age of the World Wide Web. With a foreword by Larry Wall, the creator of Perl, this carefully paced book is the "official" guide for both classroom and workplace. It is now current for Perl version 5.004.

Learning Perl is a hands-on tutorial designed to get you writing useful Perl scripts as quickly as possible. Exercises (with complete solutions) accompany each chapter. A lengthy new chapter in this edition introduces you to CGI programming, touching on the use of library modules, references, and Perl's object-oriented constructs.

Perl is a language for easily manipulating text, files, and processes. It comes standard on most UNIX platforms and is available free of charge on all other important operating systems.

Contents of the book include:

  • A quick tutorial stroll through Perl basics
  • Systematic, topic-by-topic coverage of Perl's broad capabilities
  • Lots of brief code examples
  • Programming exercises for each topic, with fully worked-out answers
  • How to execute system commands from your Perl program
  • How to manage DBM databases using Perl
  • An introduction to CGI programming for the Web
  1. Introduction
    • History of Perl
    • Purpose of Perl
    • Availability
    • Basic Concepts
    • A Stroll Through Perl
    • Exercise
  2. Scalar Data
    • What Is Scalar Data?
    • Numbers
    • Strings
    • Scalar Operators
    • Scalar Variables
    • Scalar Operators and Functions
    • <STDIN> as a Scalar Value
    • Output with print
    • The Undefined Value
    • Exercises
  3. Arrays and List Data
    • What Is a List or Array?
    • Literal Representation
    • Variables
    • Array Operators and Functions
    • Scalar and List Context
    • <STDIN> as an Array
    • Variable Interpolation of Arrays
    • Exercises
  4. Control Structures
    • Statement Blocks
    • The if/unless Statement
    • The while/until Statement
    • The for Statement
    • The foreach Statement
    • Exercises
  5. Hashes
    • What Is a Hash?
    • Hash Variables
    • Literal Representation of a Hash
    • Hash Functions
    • Hash Slices
    • Exercises
  6. Basic I/O
    • Input from STDIN
    • Input from the Diamond Operator
    • Output to STDOUT
    • Exercises
  7. Regular Expressions
    • Concepts About Regular Expressions
    • Simple Uses of Regular Expressions
    • Patterns
    • More on the Matching Operator
    • Substitutions
    • The split and join Functions
    • Exercises
  8. Functions
    • Defining a User Function
    • Invoking a User Function
    • Return Values
    • Arguments
    • Private Variables in Functions
    • Semiprivate Variables Using local
    • File-Level my( ) Variables
    • Exercises
  9. Miscellaneous Control Structures
    • The last Statement
    • The next Statement
    • The redo Statement
    • Labeled Blocks
    • Expression Modifiers
    • && and || as Control Structures
    • Exercises
  10. Filehandles and File Tests
    • What Is a Filehandle?
    • Opening and Closing a Filehandle
    • A Slight Diversion: die
    • Using Filehandles
    • The -x File Tests
    • The stat and lstat Functions
    • Exercises
  11. Formats
    • What Is a Format?
    • Defining a Format
    • Invoking a Format
    • More About the Fieldholders
    • The Top-of-Page Format
    • Changing Defaults for Formats
    • Exercises
  12. Directory Access
    • Moving Around the Directory Tree
    • Globbing
    • Directory Handles
    • Opening and Closing a Directory Handle
    • Reading a Directory Handle
    • Exercises
  13. File and Directory Manipulation
    • Removing a File
    • Renaming a File
    • Creating Alternate Names for a File: Linking
    • Making and Removing Directories
    • Modifying Permissions
    • Modifying Ownership
    • Modifying Timestamps
    • Exercises
  14. Process Management
    • Using system and exec
    • Using Backquotes
    • Using Processes as Filehandles
    • Using fork
    • Summary of Process Operations
    • Sending and Receiving Signals
    • Exercises
  15. Other Data Transformation
    • Finding a Substring
    • Extracting and Replacing a Substring
    • Formatting Data with sprintf( )
    • Advanced Sorting
    • Transliteration
    • Exercises
  16. System Database Access
    • Getting Password and Group Information
    • Packing and Unpacking Binary Data
    • Getting Network Information
    • Exercise
  17. User Database Manipulation
    • DBM Databases and DBM Hashes
    • Opening and Closing DBM Hashes
    • Using a DBM Hash
    • Fixed-Length Random Access Databases
    • Variable-Length ( Text) Databases
    • Exercises
  18. Converting Other Languages to Perl
    • Converting awk Programs to Perl
    • Converting sed Programs to Perl
    • Converting Shell Programs to Perl
    • Exercise
  19. CGI Programming
    • The CGI.pm Module
    • Your CGI Program in Context
    • Simplest CGI Program
    • Passing Parameters via CGI
    • Less Typing
    • Form Generation
    • Other Form Elements
    • Creating a Guestbook Program
    • Troubleshooting CGI Programs
    • Perl and the Web: Beyond CGI Programming
    • Further Reading
    • Exercises
  1. Exercise Answers
  2. Libraries and Modules
  3. Networking Clients
  4. Topics We Didn't Mention

Reviews

Learning Perl

Reviewed by Roland Buresund

Decent ****** (6 out of 10)

Last modified: March 21, 2022, 4:57 p.m.

Gives you the basics of Perl, what more can you ask for?

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required

captcha

required