Perl Programming For The Absolute Beginner

by
Edition: 1st
Format: Paperback
Pub. Date: 2006-06-30
Publisher(s): Cengage Learning PTR
  • Free Shipping Icon

    Free Shipping On Orders Over $35

    Your order must be $35 or more to qualify for free economy shipping. Marketplace items, eBooks and apparel do not qualify towards the $35 purchase minimum.

List Price: $29.99

Rent Book

Select for Price
There was a problem. Please try again later.

New Book

We're Sorry
Sold Out

Used Book

We're Sorry
Sold Out

eBook

We're Sorry
Not Available

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

The Perl programming language is flexible, open source, free, and widely available. "Perl Programming for the Absolute Beginner" is perfect for readers who want to learn programming using a simple language or for current programmers looking to pick up Perl. Using a unique, games-based instructional approach, the book teaches readers the basics of Perl programming, demonstrating the validating the techniques taught through the development of simple computer games. The book shows readers how to execute Perl scripts on Windows, Linux, and Macintosh and covers the latest version of the language, 5.8. All source code used in the book is available on the accompanying CD-Rom.

Table of Contents

Introductionp. xii
Introducing Perlp. 1
Perl Basicsp. 3
Project Preview: The Perl Humor Scriptp. 4
Perl Scripting Overviewp. 6
A Little Perl Historyp. 7
Where's Perl 6?p. 8
What Can Perl Scripts Do?p. 8
The Programming Language, the Interpreter, and Scriptsp. 9
Working from the Command Promptp. 10
Accessing the Command Prompt on Windows XPp. 10
Accessing the Command Prompt on Mac OS Xp. 11
Accessing the Command Prompt in Unix and Linuxp. 12
Not Everything Smells Like Rosesp. 12
Determining if Perl Is Installed on Your Computerp. 13
Where to Find Perlp. 14
Where to Find Perl's Documentationp. 17
Perldocp. 17
Man Pagesp. 19
ActiveState Documentationp. 19
Writing Your First Perl Scriptsp. 20
Creating Perl One-linersp. 20
Writing Your First Perl Script Filep. 21
Dissecting Hello.plp. 22
How Perl Executes Your Scriptp. 24
Back to the Perl Humor Scriptp. 24
Designing the Gamep. 24
The Final Resultp. 27
Summaryp. 29
Working with Strings, Numbers, and Operatorsp. 31
Project Preview: The Story of William the Greatp. 31
Perl's Free-Wheeling Approach to Code Structurep. 34
Perl's Flexible View of Datap. 37
Working with Stringsp. 37
Working with Numbersp. 41
Converting Scalar Datap. 41
Storing Data in Scalar Variablesp. 42
Variable Scopep. 42
Assigning Data to Scalar Variablesp. 43
Variable Interpolationp. 43
Understandings How to Work with Perl Operatorsp. 44
String Operatorsp. 44
Arithmetic Operatorsp. 46
Increment and Decrement Operatorsp. 48
Assignment Operatorsp. 48
Relational Operatorsp. 49
Logical Operatorsp. 50
Input and Outputp. 51
Working with Standard Inputp. 51
Working with Standard Outputp. 52
Back to the Story of William the Greatp. 52
Designing the Gamep. 52
The Final Resultp. 58
Summaryp. 63
Mastering Key Perl Programming Constructsp. 65
Controlling Program Flowp. 67
Project Preview: The Perl Fortune Teller Gamep. 68
Code Blocksp. 70
Applying Conditional Logicp. 72
Perl's View of What's True and Falsep. 72
Variations of the if Statementp. 73
The unless Statementp. 79
Creating More Sophisticated Conditional Logicp. 80
Nestingp. 80
Working with the ?...: Conditional Operatorp. 81
Creating Custom Conditional Structuresp. 81
Setting Up Loopsp. 83
Whilep. 84
Untilp. 86
Dop. 88
Forp. 89
Foreachp. 90
Adding Continue Blocks to Your Loopsp. 91
Loop Controlsp. 92
The last Statementp. 92
The next Statementp. 93
The redo Statementp. 93
Adding Labels to Your Code Blocks and Loopsp. 93
Back to the Perl Fortune Teller Gamep. 94
Designing the Gamep. 94
The Final Resultp. 100
Summaryp. 103
Working with Collections of Datap. 105
Project Preview: The Star Wars Quizp. 106
Working with Collections of Related Datap. 108
Assigning Data to a Listp. 108
Working with Arraysp. 110
Declaring an Arrayp. 110
Populating and Modifying Arrays with Datap. 112
Retrieving Data from an Arrayp. 113
Sorting Array Elementsp. 117
Deleting Array Elementsp. 118
Using Arrays to Populate Variables and Other Arraysp. 119
Ensuring That Array Elements Existp. 120
Dealing with Undefined Array Elementsp. 120
Creating Hashesp. 120
Adding and Deleting Hash Elementsp. 122
Processing Hash Contentsp. 123
Sorting Hash Valuesp. 124
Converting Between Arrays and Hashesp. 124
Understanding Context within Perlp. 124
Scalar Contextp. 125
Numeric Contextp. 125
Boolean Contextp. 126
Scalar Versus List Contextp. 126
Context and Lists, Arrays, and Hashesp. 127
Back to the Star Wars Quizp. 128
Designing the Gamep. 128
The Final Resultp. 136
Summaryp. 142
Improving Script Organization and Structurep. 145
Project Preview: The Pick a Number Gamep. 145
Enhancing Script Organizationp. 149
Organizing Perl Scripts Using Subroutinesp. 151
Defining Subroutinesp. 151
Executing Subroutinesp. 152
A Template for Organizing Your Scripts and Subroutinesp. 153
The Fortune Teller Game Revisitedp. 154
Passing Arguments to Subroutinesp. 159
Passing Data to Subroutines for Processingp. 160
Accessing Subroutine Argumentsp. 161
Reassigning Subroutine Argumentsp. 162
Passing Lists, Arrays, and Hashes as Argumentsp. 163
Getting Data Back from Subroutinesp. 164
Controlling Variable Scopep. 166
Creating Private Variablesp. 166
Getting Strict with Private Variablesp. 167
Creating Local Variablesp. 168
Back to the Pick a Number Gamep. 169
Designing the Gamep. 169
The Final Resultp. 177
Summaryp. 183
Scope and Modulesp. 185
Project Preview: The Rock, Paper, Scissors Gamep. 186
Exercising Additional Control over Variable Scopep. 189
Working with Perl Modulesp. 190
The Perl Libraryp. 191
Accessing Module Documentationp. 191
Importing Modules into Perl Scriptsp. 191
Building Custom Modulesp. 193
Defining a New Perl Modulep. 194
Saving Your Custom Modulesp. 196
Importing and Using Custom Perl Modulesp. 197
Using Other People's Perl Modulesp. 198
PPMp. 198
CPANp. 200
Back to the Rock, Paper, Scissors Gamep. 202
Building the Clear_the_screen Modulep. 203
Designing the Gamep. 203
The Final Resultp. 214
Summaryp. 223
Advanced Topicsp. 225
Regular Expressionsp. 227
Project Preview: The Lottery Picker Gamep. 228
Introducing Regular Expressionsp. 230
Matching Simple Patternsp. 231
Creating Simple Patternsp. 232
Shorter Pattern Footprintsp. 232
Working with Metacharactersp. 234
Matching Patterns at the Beginning of a Stringp. 234
Matching Patterns at the End of a Stringp. 235
Matching One or Fewer Timesp. 236
Matching Any Single Characterp. 236
Matching Zero or More Instancesp. 237
Matching One or More Instancesp. 238
Matching a Range of Instancesp. 238
Matching Alternative Patternsp. 238
Matching Any of a Collection of Charactersp. 239
Other Regular Expression Tips and Tricksp. 241
Using Patterns to Replace Datap. 241
Performing Character Translationp. 242
Handling Differences in Casep. 242
Matching Data Stored in Listsp. 243
Back to the Lottery Picker Gamep. 244
Designing the Gamep. 244
The Final Resultp. 255
Summaryp. 264
Debuggingp. 26
Project Preview: The Tic Tac Toe Gamep. 268
Understanding Perl Script Errorsp. 271
Syntax Errorsp. 272
Runtime Errorsp. 272
Logical Errorsp. 273
Examining Perl Error Messagesp. 273
Tracing Logical Flow with the Print Functionp. 275
Using the Perl Debugger to Track Down Pesky Bugsp. 276
Starting the Debuggerp. 276
Executing Additional Code Statementsp. 278
Resuming or Restarting Executionp. 280
Tracing Logic Flowp. 281
Quitting the Debuggerp. 282
Locating Your Position within the Scriptp. 282
Displaying and Modifying Variable Valuesp. 282
Displaying Help Informationp. 283
Executing any Perl Statementp. 284
Setting and Working with Breakpointsp. 285
Using the Perl Debugger as an Interactive Test Environmentp. 287
Using a Graphical Perl IDE/Debuggerp. 287
Tips for Writing Cleaner Codep. 289
Document What Your Script Is Doingp. 289
Enable Warningsp. 289
Add Use Strictp. 290
Keep Things Simplep. 291
Break Things Down into Subroutinesp. 292
Back to the Tic Tac Toe Gamep. 292
Designing the Gamep. 292
The Final Resultp. 306
Summaryp. 318
Appendicesp. 321
Perl Scripting Examplesp. 323
CGI Scriptingp. 324
Creating a Basic CGI Filep. 324
Executing Perl CGI Scriptsp. 325
Working with the CGI.pm Modulep. 327
Creating Reports and Documentsp. 328
Opening Files for Readingp. 328
Reacting to Failures when Opening Filesp. 329
Reading File Contentsp. 329
Opening Files for Writingp. 331
Writing File Outputp. 332
Closing Files when Donep. 332
Managing Files and Directoriesp. 333
Managing Filesp. 333
Managing Directoriesp. 335
PerlScript and the WSHp. 337
What's on the Companion Website?p. 343
The Book's Source Codep. 343
Advanced Text Editorsp. 344
JGsoft EditPad Litep. 345
JGsoft EditPad Prop. 345
Perl Editorsp. 347
Perl Code Editorp. 347
Perl Builder 2.0p. 347
DzSoft Perl Editorp. 348
Komodop. 348
PerlEditp. 350
What Next?p. 351
Recommended Readingp. 351
Locating Perl Resources Onlinep. 352
perl.comp. 353
The Perl Directory at Perl.orgp. 353
Perlmonksp. 353
The Comprehensive Perl Archive Networkp. 355
The Perl Foundationp. 355
Perl Mailing Listsp. 356
perl.beginnersp. 356
Yahoo! Groups: perl.beginnersp. 356
Glossaryp. 359
Indexp. 369
Table of Contents provided by Ingram. All Rights Reserved.

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.