Preface 1.Introduction Questions and Answers What Does“Perl”Stand For? HowCanIGet Perl? HOW Do I Make a Perl Program? A Whirlwind Tour of Perl Exercises 2.ScaIar Data Numbers Strings Peris Built-in Warnings Scalar Variables oUtpUt Wlth 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 L1St Literals L1‘st Assignment Interpolating Arrays I‘nto Strings The fOreach Control Structure Scalar and LiSt Context <STDIN>in LiSt Context Exercises 4.Subroutines Definlng a Subroutine Invoking a Subroutine Return Values Arguments Private Variables in Subroutines Variable-Length Parameter Lists Nores on Lexical(my)Variables The use strict Pragma The return operator Non-Scalar Return Values Exercises 5.Input and Output Input from Standard InpUt InpUt from the Diamond operator The Invocation Arguments output to Standard output Formatted Output with pringf Filehandles opening a Filehandle Fatal Errors with die Using Filehandles Reopening a Standard Filehandle Exercises 6.Hashes What Is a Hash? Hash Element Access Hash Functions Typical Use of a Hash Exercises 7.IntheWo rId 0fReguIar Expressions What Are Regular Expressions? Using Simple Patterns Character Classes Exercises 8.Matching with ReguIar ExpressiOns Marches with m// optlon Modifjers Anchors The Binding operator,=~ Interpolating into Patterns The Match Variables General Quantifiers Precedence A Pattern Test Program Exercises 9.Processing Text with Regular Expressions SubStltUtions With s/// The split Operator The join Function m//in List Context More PowerfuI Regular Expressions Exercises 10.More Control Structures The urlless 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.File Tests File Test operators The star and lstat Functions The localtltime Function BltwiSe Operators Using the Special Underscore Filehandle Exercises 12.Directory Operations Movlng Around the Directory Tree Globbing An Alternate Syntax for Globbing Directorv Handles RecursiVe Directory Listing Manipulating Files and Dlrectories Removlng Files Renaming Files Links and Files Making and Removing Dlrectorles Modifying Permissions Changing ownership Changing Timestamps Exerclses 13.Strings and Sorting Finding a Substrlng Wlth index Manipulating a Substrng Wth SUbstr Formattng Data With sprintf Advanced Sortlng ExeFcises 14.Process Management The svstem Function The exec Function The Envronment Variables Using Backquotes to Capture Output Processes as Filehandles Getting Down and Dirty with fork Sending and Receiving Signals Exercises 15. Perl Modules Finding Modules Installing Modules Using Simple Modules Exercise 16. Some Advanced PerlTechniques Trapping Errors with eval Picking Items from a List with grep Transforming Items from a List with map Unquoted Hash Keys Slices EXercise A. Exercise Answers B. Beyondthe Llama Index