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.

9780321496942

Effective Perl Programming Ways to Write Better, More Idiomatic Perl

by ; ;
  • ISBN13:

    9780321496942

  • ISBN10:

    0321496949

  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2010-04-19
  • Publisher: Addison-Wesley Professional
  • 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: $49.99
  • Digital
    $51.74
    Add to Cart

    DURATION
    PRICE

Supplemental Materials

What is included with this book?

Summary

The highly-anticipated update to this classic book - now fully reflects today's most powerful idioms and adds nine new chapters!--Packed with carefully-explained examples that show how to write Perl code like the experts do -- and why.-New chapters on CPAN, databases, debugging, distributions, external processes, files, production Perl, testing, and Unicode.-Follows Scott Meyers' best-selling Effective C++ format .-An indispensable resource for every experienced Perl programmer.Effective Perl Programming, Second Edition is the highly-anticipated update to our  best-selling guide to the Perl idioms used by experienced programmers. It not only reveals the 'right' ways to solve common problems with Perl: it explains why these approaches are so successful. Three expert authors share solutions, techniques, pointers, rules of thumb, and pitfalls to avoid: everything experienced Perl programmers need to write more powerful, fluent, expressive, and succinct code. This extensively updated and revised edition retains the 'numbered items' format of the First Edition - a format proven in Scott Meyers' best-selling Effective C++ and many successful books since. However, it is nearly twice the size of its predecessor. The additions include:-- Nine entirely new chapters on the Comprehensive Perl Archive Network (CPAN), Databases, Debugging, Distributions, External Processes, Files and Filehandles, Production Perl, Testing, and Unicode.-Systematically updated examples that reflect today's best idioms.-More coverage of applications and user interface techniques.-New exercises and solutions that provide more hands-on practice, and add value in training environments. 

Author Biography

Joseph N. Hall has programmed for a living since 1984, taught his first computer class at age fourteen, and has worked with Perl since 1993. Joshua A. McAdams, a programmer at Google, is the voice of Perlcast. He has hosted two Perl conferences, conducts meetings for Chicago Perl Mongers, has spoken about Perl at events worldwide, and is a CPAN author. brian d foy is coauthor of Learning Perl, Fifth edition (O'Reilly Media, 2008), and intermediate Perl (O'Reilly Media,2006), and author of Mastering Perl (O'Reilly Media,2007). He established the first Perl user group, the New York Perl Mongers; publishes The Perl Review; maintains parts of the core Perl documentation; and has more than ten Years of Perl training experience.

Table of Contents

Forewordp. xi
Prefacep. xiii
Acknowledgmentsp. xvii
About the Authorsp. xix
Introductionp. 1
The Basics of Perlp. 9
Find the documentation for Perl and its modulesp. 9
Enable new Perl features when you need themp. 12
Enable strictures to promote better codingp. 14
Understand what sigils are telling youp. 17
Know your variable namespacesp. 19
Know the difference between string and numeric comparisonsp. 21
Know which values are false and test them accordinglyp. 23
Understand conversions between strings and numbersp. 27
Know the difference between lists and arraysp. 31
Don't assign undef when you want an empty arrayp. 34
Avoid a slice when you want an elementp. 37
Understand context and how it affects operationsp. 41
Use arrays or hashes to group datap. 45
Handle big numbers with bignump. 47
Idiomatic Perlp. 51
Use $-for elegance and brevityp. 53
Know Perl's other default argumentsp. 56
Know common shorthand and syntax quirksp. 60
Avoid excessive punctuationp. 66
Format lists for easy maintenancep. 68
Use foreach, map, and grep as appropriatep. 70
Know the different ways to quote stringsp. 73
Learn the myriad ways of sortingp. 77
Make work easier with smart matchingp. 84
Use given-when to make a switch statementp. 86
Use do {} to create inline subroutinesp. 90
Use List: :Util and List: :MoreUtils for easy list manipulationp. 92
Use autodie to simplify error handlingp. 96
Regular Expressionsp. 99
Know the precedence of regular expression operatorsp. 99
Use regular expression capturesp. 103
Use more precise whitespace character classesp. 110
Use named captures to label matchesp. 114
Use noncapturing parentheses when you need only groupingp. 116
Watch out for the match variablesp. 117
Avoid greed when parsimony is bestp. 119
Use zero-width assertions to match positions in a stringp. 121
Avoid using regular expressions for simple string operationsp. 125
Make regular expressions readablep. 129
Avoid unnecessary backtrackingp. 132
Compile regexes only oncep. 137
Pre-compile regular expressionsp. 138
Benchmark your regular expressionsp. 139
Don't reinvent the regexp. 142
Subroutinesp. 145
Understand the difference between my and localp. 145
Avoid using @-directly unless you have top. 154
Use wantarray to write subroutines returning listsp. 157
Pass references instead of copiesp. 160
Use hashes to pass named parametersp. 164
Use prototypes to get special argument parsingp. 168
Create closures to lock in datap. 171
Create new subroutines with subroutinesp. 176
Files and Filehandlesp. 179
Don't ignore the file test operatorsp. 179
Always use the three-argument openp. 182
Consider different ways of reading from a streamp. 183
Open filehandles to and from stringsp. 186
Make flexible outputp. 189
Use File: :Spec or Path: :Class to work with pathsp. 192
Leave most of the data on disk to save memoryp. 195
Referencesp. 201
Understand references and reference syntaxp. 201
Compare reference types to prototypesp. 209
Create arrays of arrays with referencesp. 211
Don't confuse anonymous arrays with list literalsp. 214
Build C-style structs with anonymous hashesp. 216
Be careful with circular data structuresp. 218
Use map and grep to manipulate complex data structuresp. 221
CPANp. 227
Install CPAN modules without admin privilegesp. 228
Carry a CPAN with youp. 231
Mitigate the risk of public codep. 235
Research modules before you install themp. 239
Ensure that Perl can find your modulesp. 242
Contribute to CPANp. 246
Know the commonly used modulesp. 250
Unicodep. 253
Use Unicode in your source codep. 254
Tell Perl which encoding to usep. 257
Specify Unicode characters by code point or namep. 258
Convert octet strings to character stringsp. 261
Match Unicode characters and propertiesp. 265
Work with graphemes instead of charactersp. 269
Be careful with Unicode in your databasesp. 272
Distributionsp. 275
Use Module: :Build as your distribution builderp. 275
Don't start distributions by handp. 278
Choose a good module namep. 283
Embed your documentation with Podp. 287
Limit your distributions to the right platformsp. 292
Check your Podp. 295
Inline code for other languagesp. 298
Use XS for low-level interfaces and speedp. 301
Testingp. 307
Use prove for flexible test runsp. 308
Run tests only when they make sensep. 311
Use dependency injection to avoid special test logicp. 314
Don't require more than you need to use in your methodsp. 317
Write programs as modulinos for easy testingp. 320
Mock objects and interfaces to focus testsp. 324
Use SQLite to create test databasesp. 330
UseTest: :Class for more structured testingp. 332
Start testing at the beginning of your projectp. 335
Measure your test coveragep. 342
Use CPAN Testers as your QA teamp. 346
Set up a continuous build systemp. 348
Warningsp. 357
Enable warnings to let Perl spot suspicious codep. 358
Use lexical warnings to selectively turn on or off complaintsp. 361
Use die to generate exceptionsp. 364
Use Carp to get stack tracesp. 366
Handle exceptions properlyp. 370
Track dangerous data with taint checkingp. 372
Start with taint warnings for legacy codep. 375
Databasesp. 377
Prepare your SQL statements to reuse work and save timep. 377
Use SQL placeholders for automatic value quotingp. 382
Bind return columns for faster access to datap. 384
Reuse database connectionsp. 386
Miscellanyp. 391
Compile and install your own Perlsp. 391
Use Perl: :Tidy to beautify codep. 394
Use Perl Criticp. 398
Use Log: :Log4perl to record your program's statep. 403
Know when arrays are modified in a loopp. 410
Don't use regular expressions for com ma-separated valuesp. 412
Use unpack to process columnar datap. 414
Use pack and unpack for data mungingp. 416
Access the symbol table with typeglobsp. 423
Initialize with BEGIN; finish with ENDp. 425
Use Perl one-liners to create mini programsp. 428
Perl Resourcesp. 435
Map from First to Second Editionp. 439
Booksp. 435
Websitesp. 436
Blogs and Podcastsp. 437
Getting Helpp. 437
Indexp. 445
Table of Contents provided by Ingram. All Rights Reserved.

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