Buying Options
Perl Best Practices
Print $39.95
Add to Cart
Print+Ebook $43.95
Add to Cart
Ebook $31.99
Add to Cart
Safari Books Online
Add to Cart
What is this?
Print £30.50
Add to Cart
What is this?
Description
Perl Best Practices offers a collection of 256 guidelines on the art of coding to help you write better Perl code--in fact, the best Perl code you possibly can. The guidelines cover code layout, naming conventions, choice of data and control structures, program decomposition, interface design and implementation, modularity, object orientation, error handling, testing, and debugging.
Full Description
Table of Contents
  1. Chapter 1 Best Practices

    1. Three Goals

    2. This Book

    3. Rehabiting

  2. Chapter 2 Code Layout

    1. Bracketing

    2. Keywords

    3. Subroutines and Variables

    4. Builtins

    5. Keys and Indices

    6. Operators

    7. Semicolons

    8. Commas

    9. Line Lengths

    10. Indentation

    11. Tabs

    12. Blocks

    13. Chunking

    14. Elses

    15. Vertical Alignment

    16. Breaking Long Lines

    17. Non-Terminal Expressions

    18. Breaking by Precedence

    19. Assignments

    20. Ternaries

    21. Lists

    22. Automated Layout

  3. Chapter 3 Naming Conventions

    1. Identifiers

    2. Booleans

    3. Reference Variables

    4. Arrays and Hashes

    5. Underscores

    6. Capitalization

    7. Abbreviations

    8. Ambiguous Abbreviations

    9. Ambiguous Names

    10. Utility Subroutines

  4. Chapter 4 Values and Expressions

    1. String Delimiters

    2. Empty Strings

    3. Single-Character Strings

    4. Escaped Characters

    5. Constants

    6. Leading Zeros

    7. Long Numbers

    8. Multiline Strings

    9. Here Documents

    10. Heredoc Indentation

    11. Heredoc Terminators

    12. Heredoc Quoters

    13. Barewords

    14. Fat Commas

    15. Thin Commas

    16. Low-Precedence Operators

    17. Lists

    18. List Membership

  5. Chapter 5 Variables

    1. Lexical Variables

    2. Package Variables

    3. Localization

    4. Initialization

    5. Punctuation Variables

    6. Localizing Punctuation Variables

    7. Match Variables

    8. Dollar-Underscore

    9. Array Indices

    10. Slicing

    11. Slice Layout

    12. Slice Factoring

  6. Chapter 6 Control Structures

    1. If Blocks

    2. Postfix Selectors

    3. Other Postfix Modifiers

    4. Negative Control Statements

    5. C-Style Loops

    6. Unnecessary Subscripting

    7. Necessary Subscripting

    8. Iterator Variables

    9. Non-Lexical Loop Iterators

    10. List Generation

    11. List Selections

    12. List Transformation

    13. Complex Mappings

    14. List Processing Side Effects

    15. Multipart Selections

    16. Value Switches

    17. Tabular Ternaries

    18. do-while Loops

    19. Linear Coding

    20. Distributed Control

    21. Redoing

    22. Loop Labels

  7. Chapter 7 Documentation

    1. Types of Documentation

    2. Boilerplates

    3. Extended Boilerplates

    4. Location

    5. Contiguity

    6. Position

    7. Technical Documentation

    8. Comments

    9. Algorithmic Documentation

    10. Elucidating Documentation

    11. Defensive Documentation

    12. Indicative Documentation

    13. Discursive Documentation

    14. Proofreading

  8. Chapter 8 Built-in Functions

    1. Sorting

    2. Reversing Lists

    3. Reversing Scalars

    4. Fixed-Width Data

    5. Separated Data

    6. Variable-Width Data

    7. String Evaluations

    8. Automating Sorts

    9. Substrings

    10. Hash Values

    11. Globbing

    12. Sleeping

    13. Mapping and Grepping

    14. Utilities

  9. Chapter 9 Subroutines

    1. Call Syntax

    2. Homonyms

    3. Argument Lists

    4. Named Arguments

    5. Missing Arguments

    6. Default Argument Values

    7. Scalar Return Values

    8. Contextual Return Values

    9. Multi-Contextual Return Values

    10. Prototypes

    11. Implicit Returns

    12. Returning Failure

  10. Chapter 10 I/O

    1. Filehandles

    2. Indirect Filehandles

    3. Localizing Filehandles

    4. Opening Cleanly

    5. Error Checking

    6. Cleanup

    7. Input Loops

    8. Line-Based Input

    9. Simple Slurping

    10. Power Slurping

    11. Standard Input

    12. Printing to Filehandles

    13. Simple Prompting

    14. Interactivity

    15. Power Prompting

    16. Progress Indicators

    17. Automatic Progress Indicators

    18. Autoflushing

  11. Chapter 11 References

    1. Dereferencing

    2. Braced References

    3. Symbolic References

    4. Cyclic References

  12. Chapter 12 Regular Expressions

    1. Extended Formatting

    2. Line Boundaries

    3. String Boundaries

    4. End of String

    5. Matching Anything

    6. Lazy Flags

    7. Brace Delimiters

    8. Other Delimiters

    9. Metacharacters

    10. Named Characters

    11. Properties

    12. Whitespace

    13. Unconstrained Repetitions

    14. Capturing Parentheses

    15. Captured Values

    16. Capture Variables

    17. Piecewise Matching

    18. Tabular Regexes

    19. Constructing Regexes

    20. Canned Regexes

    21. Alternations

    22. Factoring Alternations

    23. Backtracking

    24. String Comparisons

  13. Chapter 13 Error Handling

    1. Exceptions

    2. Builtin Failures

    3. Contextual Failure

    4. Systemic Failure

    5. Recoverable Failure

    6. Reporting Failure

    7. Error Messages

    8. Documenting Errors

    9. OO Exceptions

    10. Volatile Error Messages

    11. Exception Hierarchies

    12. Processing Exceptions

    13. Exception Classes

    14. Unpacking Exceptions

  14. Chapter 14 Command-Line Processing

    1. Command-Line Structure

    2. Command-Line Conventions

    3. Meta-options

    4. In-situ Arguments

    5. Command-Line Processing

    6. Interface Consistency

    7. Interapplication Consistency

  15. Chapter 15 Objects

    1. Using OO

    2. Criteria

    3. Pseudohashes

    4. Restricted Hashes

    5. Encapsulation

    6. Constructors

    7. Cloning

    8. Destructors

    9. Methods

    10. Accessors

    11. Lvalue Accessors

    12. Indirect Objects

    13. Class Interfaces

    14. Operator Overloading

    15. Coercions

  16. Chapter 16 Class Hierarchies

    1. Inheritance

    2. Objects

    3. Blessing Objects

    4. Constructor Arguments

    5. Base Class Initialization

    6. Construction and Destruction

    7. Automating Class Hierarchies

    8. Attribute Demolition

    9. Attribute Building

    10. Coercions

    11. Cumulative Methods

    12. Autoloading

  17. Chapter 17 Modules

    1. Interfaces

    2. Refactoring

    3. Version Numbers

    4. Version Requirements

    5. Exporting

    6. Declarative Exporting

    7. Interface Variables

    8. Creating Modules

    9. The Standard Library

    10. CPAN

  18. Chapter 18 Testing and Debugging

    1. Test Cases

    2. Modular Testing

    3. Test Suites

    4. Failure

    5. What to Test

    6. Debugging and Testing

    7. Strictures

    8. Warnings

    9. Correctness

    10. Overriding Strictures

    11. The Debugger

    12. Manual Debugging

    13. Semi-Automatic Debugging

  19. Chapter 19 Miscellanea

    1. Revision Control

    2. Other Languages

    3. Configuration Files

    4. Formats

    5. Ties

    6. Cleverness

    7. Encapsulated Cleverness

    8. Benchmarking

    9. Memory

    10. Caching

    11. Memoization

    12. Caching for Optimization

    13. Profiling

    14. Enbugging

  1. Appendix Essential Perl Best Practices

  2. Appendix Perl Best Practices

    1. , Code Layout

    2. , Naming Conventions

    3. , Values and Expressions

    4. , Variables

    5. , Control Structures

    6. , Documentation

    7. , Built-in Functions

    8. , Subroutines

    9. , I/O

    10. , References

    11. , Regular Expressions

    12. , Error Handling

    13. , Command-Line Processing

    14. , Objects

    15. , Class Hierarchies

    16. , Modules

    17. , Testing and Debugging

    18. , Miscellanea

  3. Appendix Editor Configurations

    1. vim

    2. vile

    3. Emacs

    4. BBEdit

    5. TextWrangler

  4. Appendix Recommended Modules and Utilities

    1. Recommended Core Modules

    2. Recommended CPAN Modules

    3. Utility Subroutines

  5. Appendix Bibliography

    1. Perl Coding and Development Practices

    2. General Coding and Development Practices

  6. Colophon

View Full Table of Contents
Product Details
Title:
Perl Best Practices
By:
Damian Conway
Publisher:
O'Reilly Media
Formats:
  • Print
  • Ebook
  • Safari Books Online
Print Release:
July 2005
Ebook Release:
June 2009
Pages:
544
Print ISBN:
978-0-596-00173-5
| ISBN 10:
0-596-00173-8
Ebook ISBN:
978-0-596-15900-9
| ISBN 10:
0-596-15900-5
Customer Reviews
About the Author
  1. Damian Conway

    Damian Conway holds a PhD in Computer Science and is an honorary Associate Professor with the School of Computer Science and Software Engineering at Monash University, Melbourne, Australia. Currently he runs an international IT training company--Thoughtstream--which provides programmer development from beginner to masterclass level throughout Europe, North America, and Australasia. Damian was the winner of the 1998, 1999, and 2000 Larry Wall Awards for Practical Utility. The best technical paper at the annual Perl Conference was subsequently named in his honour. He is a member of the technical committee for The Perl Conference, a keynote speaker at many Open Source conferences, a former columnist for The Perl Journal, and author of the book Object Oriented Perl. In 2001 Damian received the first "Perl Foundation Development Grant" and spent 20 months working on projects for the betterment of Perl. A popular speaker and trainer, he is also the author of numerous well-known Perl modules, including Parse::RecDescent (a sophisticated parsing tool), Class::Contract (design-by-contract programming in Perl), Lingua::EN::Inflect (rule-based English transformations for text generation), Class::Multimethods (multiple dispatch polymorphism), Text::Autoformat (intelligent automatic reformatting of plaintext), Switch (Perl's missing case statement), NEXT (resumptive method dispatch), Filter::Simple (Perl-based source code manipulation), Quantum::Superpositions (auto-parallelization of serial code using a quantum mechanical metaphor), and Lingua::Romana::Perligata (programming in Latin). Most of his time is now spent working with Larry Wall on the design of the new Perl 6 programming language.

    View Damian Conway's full profile page.

  • Book cover of Perl Best Practices