did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9781590593912

Beginning Perl

by
  • ISBN13:

    9781590593912

  • ISBN10:

    159059391X

  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2004-09-06
  • Publisher: Apress
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $39.99

Summary

Immensely popular Perl combines the best features of C, key UNIX utilities, and powerful regular expressions. This second edition dispels the image of Perl as a sometimes confusing, obscure language, and instead, promotes Perl as a legible, sensible programming language. Concise and focused, this book reaches out to users of all experience levels, and covers basic to advanced aspects of Perl, Apache modPerl, and Perlscript (for use with Wintel systems). This book also stresses the cross-platform nature of Perl. Covers what a new Perl programmer needs to know, using real-world examples.

Table of Contents

About the Author xv
Acknowledgments xvii
Introduction xix
CHAPTER 1 First Steps in Perl 1(12)
Programming Languages
1(1)
Our First Perl Program
2(6)
Program Structure
5(3)
Escape Sequences
8(1)
Whitespace
8(1)
Number Systems
8(2)
The Perl Debugger
10(1)
Summary
10(1)
Exercises
11(2)
CHAPTER 2 Scalars 13(38)
Types of Data
13(8)
Numbers
14(3)
Strings
17(3)
Here-Documents
20(1)
Converting Between Numbers and Strings
20(1)
Operators
21(16)
Numeric Operators
22(9)
String Operators
31(4)
Operators to Be Seen Later
35(1)
Operator Precedence
36(1)
Variables
37(7)
Scoping
41(3)
Variable Names
44(1)
Variable Interpolation
44(4)
Currency Converter
46(2)
Two Miscellaneous Functions
48(2)
The exit() Function
48(1)
The die() Function
49(1)
Summary
50(1)
Exercises
50(1)
CHAPTER 3 Control Flow Constructs 51(26)
The if Statement
52(11)
Operators Revisited
53(5)
Multiple Choice: if...else
58(3)
The unless Statement
61(1)
Expression Modifiers
62(1)
Using Short-Circuited Evaluation
63(1)
Looping Constructs
63(1)
The while Loop
63(8)
while ([STDIN]) 65
Infinite Loops
66(1)
Looping Until
67(1)
The for Loop
68(1)
The foreach Loop
68(1)
do..while and do..until
69(2)
Loop Control Constructs
71(5)
Breaking Out
71(1)
Going On to the Next
72(1)
Reexecuting the Loop
73(1)
Loop Labels
74(2)
goto
76(1)
Summary
76(1)
Exercises
76(1)
CHAPTER 4 Lists and Arrays 77(34)
Lists
77(10)
Simple Lists
77(1)
Less Simple Lists
78(2)
Creating Lists Easily with qw//
80(3)
Accessing List Values
83(4)
Arrays
87(22)
Assigning Arrays
87(3)
Scalar vs. List Context
90(1)
Adding to an Array
91(1)
Accessing an Array
91(18)
Summary
109(1)
Exercises
110(1)
CHAPTER 5 Hashes 111(16)
Creating a Hash
111(4)
Working with Hash Values
113(2)
Hash in List Context
115(1)
Hash in Scalar Context
116(1)
Hash Functions
117(4)
The keys() Function
117(1)
The values() Function
118(1)
The each() Function
119(1)
The delete() Function
120(1)
The exists() Function
120(1)
Hash Examples
121(4)
Creating Readable Variables
121(1)
"Reversing" Information
121(1)
Counting Things
122(3)
Summary
125(1)
Exercises
125(2)
CHAPTER 6 Subroutines/Functions 127(22)
Understanding Subroutines
128(5)
Defining a Subroutine
128(1)
Invoking a Subroutine
129(1)
Order of Declaration and Invoking Functions
130(3)
Passing Arguments into Functions
133(4)
Return Values
134(3)
Understanding Scope
137(4)
Global Variables
137(1)
Introduction to Packages
138(2)
Lexical Variables (aka Local Variables)
140(1)
Some Important Notes on Passing Arguments
141(6)
Function Arguments Passed by Reference
141(2)
Lists Are One Dimensional
143(2)
Default Argument Values
145(1)
Named Parameters
145(2)
Summary
147(1)
Exercises
147(2)
CHAPTER 7 Regular Expressions 149(28)
What Are They?
150(18)
Patterns
150(18)
Working with Regexes
168(7)
Substitution
168(2)
Changing Delimiters
170(1)
Modifiers
171(1)
The split()Function
172(1)
The join() Function
173(1)
Common Blunders
174(1)
Summary
175(1)
Exercises
175(2)
CHAPTER 8 Files and Data 177(28)
Filehandles
177(6)
The open() Function
177(1)
The close() Function
178(2)
Three Ways to Open a File
180(1)
Reading in Scalar Context
181(2)
Reading with the Diamond
183(7)
@ARGV: The Command Line Arguments
186(2)
@ARGV and [] 187
$ARGV
188(1)
Reading in List Context
188(2)
Writing to Files
190(4)
Buffering
193(1)
Opening Pipes
194(5)
Piping In from a Process
194(2)
Piping Out to Processes
196(2)
Bidirectional Pipes
198(1)
File Tests
199(5)
Summary
204(1)
Exercises
204(1)
CHAPTER 9 String Processing 205(8)
Character Position
205(1)
String Functions
206(5)
The Iength() Function
206(1)
TheindexO Function
206(2)
The rindex() Function
208(1)
The substr() Function
208(2)
Transliteration
210(1)
Summary
211(1)
Exercises
211(2)
CHAPTER 10 Interfacing to the Operating System 213(16)
The %ENV Hash
213(2)
Working with Files and Directories
215(8)
File Globbing
215(3)
Reading Directories
218(1)
Functions to Work with Files and Directories
219(4)
Executing External Programs
223(3)
The system() Function
223(2)
Backquotes
225(1)
There's More
226(1)
Summary
227(1)
Exercises
227(2)
CHAPTER 11 References 229(24)
What Is a Reference?
229(1)
Anonymity
230(1)
The Life Cycle of a Reference
230(12)
Reference Creation
230(7)
Reference Modification
237(4)
Reference Counting and Destruction
241(1)
Using References for Complex Data Structures
242(8)
Matrices
242(1)
Autovivification
243(4)
Trees
247(3)
Summary
250(1)
Exercises
251(2)
CHAPTER 12 Object-Oriented Per! 253(34)
Improving Your Vocabulary
253(5)
Objects
253(1)
Attributes
254(1)
Methods
254(1)
Classes
255(1)
Polymorphism
256(1)
Encapsulation
256(1)
Inheritance
256(1)
Constructors
257(1)
Destructors
258(1)
An Example
258(3)
Including Other Files with use
261(3)
do
261(1)
require
262(1)
use
263(1)
Changing @INC
263(1)
Rolling Your Own Classes
264(19)
Bless You, My Reference
265(2)
Storing Attributes
267(1)
The Constructor
268(3)
Creating Methods
271(12)
Do You Need 00?
283(1)
Are Your Subroutines Tasks?
283(1)
Do You Need Persistence?
284(1)
Do You Need Sessions?
284(1)
Do You Need Speed?
284(1)
Do You Want the User to Be Unaware of the Object?
284(1)
Are You Still Unsure?
284(1)
Summary
284(1)
Exercises
285(2)
CHAPTER 13 Modules 287(28)
Why Do We Need Them?
287(1)
Package Hierarchies
288(1)
Exporters
288(2)
Online Documentation
290(1)
Creating a Non-00 Module
290(5)
The Perl Standard Modules
295(10)
Data::Dumper
295(2)
File::Find
297(1)
Getopt::Std
298(2)
Getopt::Long
300(1)
File::Spec
301(1)
Benchmark
302(2)
Win32
304(1)
CPAN
305(8)
Installing Modules with PPM
307(1)
Installing a Module Manually
308(1)
The CPAN Module
308(3)
Bundles
311(1)
Submitting Your Own Module to CPAN
312(1)
Summary
313(2)
CHAPTER 14 Introduction to CGI 315(32)
We Need a Webserver
316(1)
Creating a CGI Directory
316(1)
Writing CGI Programs
316(6)
"hello, world!" in CGI
317(2)
The CGI Environment
319(1)
Generating HTML
320(2)
Introducing CGI.pm
322(7)
Conventional Style of Calling Methods
328(1)
CGI.pm Methods
329(1)
Methods That Generate More Than One Tag
329(1)
Methods That Generate One Tag
330(1)
Processing Form Data
330(5)
The param() Method
332(1)
Dynamic CGI Program
333(2)
Let's Play Chess l
335(9)
Improvements We Can Make
344(1)
What We Did Not Talk About
344(1)
Summary
345(1)
Exercises
346(1)
CHAPTER 15 Perl and DBI 347(38)
Introduction to Relational Databases
347(3)
The Relational of Relational Database
348(2)
We Need an SQL Server-MySQL
350(15)
Installing MySQL
350(1)
Testing the MySQL Server
351(1)
Creating a Database
352(2)
Creating a Non-root User with the GRANT Command
354(1)
The INSERT Command
355(3)
The SELECT Command
358(6)
Table Joins
364(1)
Introduction to DBI
365(10)
Installing DBI and the DBD::mysgl
365(1)
Connecting to the MySQL Database
366(1)
Executing an SQL Query with DBI
367(2)
A More Complex Example
369(3)
Use Placeholders
372(2)
DBI and Table Joins
374(1)
Perl + DBI + CGI = Fun!
375(7)
What We Didn't Talk About
382(1)
Summary
383(1)
Exercises
383(2)
APPENDIX Exercise Solutions 385(22)
INDEX 407

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program