Perl 201: Advanced Concepts in Perl Programming
About this Course
Master the full potential of Perl. Build on the knowledge learned in Perl 101 to complete your understanding of Perl's fundamentals. Learn advanced regular expressions, references, object-oriented programming, networking, writing Perl modules, and other topics.
You Will Learn How To
- Build on Perl skills developed in Perl 101
- Develop a comprehensive mastery of the core language of Perl
- Understand references and data structures
- Write Perl modules that export subroutines
- Use object-oriented Perl modules
- Write your own OO modules
Who should attend?
- Linux, Unix, and Windows system administrators
- Network engineers
- Quality assurance engineers
- Hardware engineers
- Web developers
- Anyone who needs to write more advanced Perl scripts
Prerequisites:
Perl 101 or equivalent experience.
Programming Environment:
Perl runs on any modern operating system, and our lab exercises are operating-system-independent. You may bring a laptop running Windows, Mac, or Linux for your lab exercises, or use the workstation we provide (typically running Windows). Any text editor may be used to edit Perl code for the lab exercises.
Course Materials:
All classes include printed course materials and a CD-ROM with course materials and lab solutions. A workstation is available for you to do your lab exercises, but you are welcome to bring your own laptop and use it instead.
Course Outline:
- Subroutines II
Detecting scalar vs. list context; Subroutine declaration; Subroutine prototypes; Declaring prototyped subroutines
- Writing Perl Modules
Goal: reusable code (Don't Repeat Yourself); Packages; Naming your module; Structure of a Perl module; Exporting Subroutines; Sharing your work
- Advanced List Functions
Custom Sort Order; Sort by numeric or string comparison; Sort in reverse order; Sort by multiple criteria; Searching in arrays: grep; Returning modified list: map
- Filesystem manipulation
Changing file permissions and owner (Unix, Linux, Mac); Understanding file permissions; File user and group owner; Changing owner/group: chown; Changing permissions: chmod; Creating directories: mkdir; Removing directories: rmdir; Deleting files: unlink; Renaming or moving files: rename; Symbolic links: symlink; File statistics: stat; Windows file permissions
- Running External Programs
Security caveat; Run a program: system; Backticks; Pipes; Writing to a pipe; Reading from a pipe; Fork; Exec
- Setting I/O Options
Input line separator: $/; Affect of $/ on chomp; Paragraph mode; Slurp mode; Default output filehandle: select; Controlling buffering: $|; Using select and $| together
- Regular Expressions II
Advanced features of Perl's regular expression engine; Greedy vs. non-greedy; Word boundaries; Advanced modifiers: /m, /s, /o; Split with regular expression using parentheses; Non-memorizing parentheses; Applying modifier to part of expression
- References
What is a reference?; Reference syntax; Visualizing references; Memory management in Perl; Dereferencing syntax; Arrows for accessing array or hash elements; Array and hash operations using references; Reference types
- Data Structures
Arrays or hashes containing hashes or arrays; Accessing the contents; When are arrows optional?; Visualizing a two-dimensional array; Anonymous arrays and hashes; Confusing brackets; Sorting data structures
- Using Object-Oriented Modules
Basic Object-Oriented (OO) concepts; Why use OO?; How Perl implements OO; Classes and Packages; Objects and References; Methods and Subroutines; Constructors; Blessed Objects; Inheritance; Object-Oriented Syntax; Example OO Modules
- Writing Object-Oriented Modules
Modules: Exporting vs. Object-Oriented; Structure of an OO Module; Deciding how to store data; Writing the constructor; Accessing data in methods; Implementing Inheritance; Further Reading
- Subroutine References
Reference to existing subroutine; Anonymous subroutines; Vector table; Callbacks; Example: Benchmark
Class Format
This class is available as a one-day seminar, open to all for enrollment. For more information, see the Seminars page. All-Day courses are held from 9:00 AM to approximately 6:00 PM with a one-hour break for lunch from noon to 1:00 PM. Light snacks and beverages are included; lunch is not.
Upcoming dates for this class:
On-Site Training
This class is also available as an on-site class. See our On-Site Training page for more information.
Course details subject to change without notice. All classes are conducted in English.
Last updated: 02/12/2010
Copyright © 1995-2008 William R. Ward dba Bay View Training. All Rights Reserved. “Bay View Training”, “Bay View Consulting Services”, “Bay View Software”, the sailboat logo, and the domain name “bayview.com” are trademarks and/or service marks of William R. Ward dba Bay View Training. For more information, contact training@bayview.com
