One of the major challenges of using Perl in a development environment is that Perl's "More Than One Way To Do It" philosophy often means there are far too many choices when it comes to solving a particular problem using the language. This makes coding standards and the use of best-practice techniques especially important in Perl development.
The full three-day course explores maintainable, robust, and efficient coding practices for:
- Data
- use of constants
- barewords
- references and dereferencing
- Variables
- general naming conventions
- naming conventions for non-scalars
- multi-level vs multi-part keys
- sanitizing Perl's magic punctuation variables
- Subroutines
- layout
- calling conventions
- argument passing conventions
- use of prototypes
- Functions and control structures
- choosing between maps and for loops
- efficient sorting techniques
- Packages and modules
- naming conventions
- designing module interfaces
- exporting symbols
- package layout
- lexicals vs package variables
- use of the standard library and CPAN modules
- Object-orientation
- interface design
- method and attribute naming conventions
- inheritance and polymorphism issues in advanced classes
- reliable OO constructor and destructor techniques
- standardized encapsulation
- use and preferred implementation of class attributes
- Control flow
- standardizing loop structures
- prefix vs postfix controls
- considerations in selecting between list processing and iteration
- Error handling
- error detection
- lexical vs "classic" warnings
- warning and error handlers
- reporting errors
- return values vs exceptions
- I/O
- file I/O
- stream I/O
- efficient file slurping (linear and recursive)
- Documentation
- commenting styles
- pod layout and structure
- tactical and strategic documentation
- consistency techniques
- Interface design
- general principles
- "intuitive" design techniques
- interface size vs convenience
- Miscellaneous
- use and flagging of context
- standards for command-line syntax design and parsing
- handling common data formats (e.g. CSV, HTML, XML)
The one- and two-day course variants cover selected subsets of the above material and can be tailored to highlight particular areas of interest and differing levels of experience.
1, 2, or 3 days seminar
Perl programmers who work as part of a development team or who simply wish to write better, more reliable, ore maintainable code.