Open Source Home

Open Source Articles

Open Source Links

Open Source Books

Open Source Tools

Open Source Keywords



Open Source

Learning Perl, 3rd Edition

See more Amazon Details

Contents Listing

Preface

1. Introduction
Questions and Answers
What Does "Perl" Stand For?
How Can I Get Perl?
How Do I Make a Perl Program?
A Whirlwind Tour of Perl
Exercises

2. Scalar Data
What Is Scalar Data?
Numbers
Strings
Perl's Built-in Warnings
Scalar Variables
Output with print
The if Control Structure
Getting User Input
The chomp Operator
The while Control Structure
The undef Value
The defined Function
Exercises

3. Lists and Arrays
Accessing Elements of an Array
Special Array Indices
List Literals
List Assignment
Interpolating Arrays into Strings
The foreach Control Structure
Perl's Favorite Default: $_
Scalar and List Context
in List Context
Exercises

4. Subroutines
System and User Functions
Defining a Subroutine
Invoking a Subroutine
Return Values
Arguments
Private Variables in Subroutines
The local Operator
Variable-length Parameter Lists
Notes on Lexical (my) Variables
The use strict Pragma
The return Operator
Exercises

5. Hashes
What Is a Hash?
Hash Element Access
Hash Functions
Typical Use of a Hash
Exercises

6. I/O Basics
Input from Standard Input
Input from the Diamond Operator
The Invocation Arguments
Output to Standard Output
Formatted Output with printf
Exercises

7. Concepts of Regular Expressions
What Are Regular Expressions?
Using Simple Patterns
A Pattern Test Program
Exercises

8. More About Regular Expressions
Character Classes
General Quantifiers
Anchors
Memory Parentheses
Precedence
Exercises

9. Using Regular Expressions
Matches with m//
Option Modifiers
The Binding Operator, =~
Interpolating into Patterns
The Match Variables
Substitutions with s///
The split Operator
The join Function
Exercises

10. More Control Structures
The unless Control Structure
The until Control Structure
Expression Modifiers
The Naked Block Control Structure
The elsif Clause
Autoincrement and Autodecrement
The for Control Structure
Loop Controls
Logical Operators
Exercise

11. Filehandles and File Tests
What Is a Filehandle?
Opening a Filehandle
Fatal Errors with die
Using Filehandles
Reopening a Standard Filehandle
File Tests
Exercises

12. Directory Operations
Moving Around the Directory Tree
Globbing
An Alternate Syntax for Globbing
Directory Handles
Recursive Directory Listing
Exercises

13. Manipulating Files and Directories
Removing Files
Renaming Files
Links and Files
Making and Removing Directories
Modifying Permissions
Changing Ownership
Changing Timestamps
Using Simple Modules
Exercises

14. Process Management
The system Function
The exec Function
The Environment Variables
Using Backquotes to Capture Output
Processes as Filehandles
Getting Down and Dirty with Fork
Sending and Receiving Signals
Exercises

15. Strings and Sorting
Finding a Substring with index
Manipulating a Substring with substr
Formatting Data with sprintf
Advanced Sorting
Exercises

16. Simple Databases
DBM Files and DBM Hashes
Manipulating Data with pack and unpack
Fixed-length Random-access Databases
Variable-length (Text) Databases
Exercises

17. Some Advanced Perl Techniques
Trapping Errors with eval
Picking Items from a List with grep
Transforming Items from a List with map
Unquoted Hash Keys
More Powerful Regular Expressions
Slices
Exercise

A. Exercise Answers

B. Beyond the Llama

Index

Google
Web www.opensource.force9.co.uk

Contents
View a contents listing.

Short
Short Description.


Keyword Pages

Keyword Bestsellers

Open Source Bestsellers
The bestselling books on Amazon.

Articles

Birmingham Evaluates Open-Source

MySQL and Red Hat

Bank Saving 50 percent on Sun to Linux Move

Red Hat Sales and Profit Leap

Visit our site of the month Sarbanes-Oxley at www.sarbanesoxleyuk.co.uk
Visit our site of the month Sarbanes-Oxley at www.sarbanesoxleyuk.co.uk