Perl 5 Essential Training
5h 27mBeginner2016-06-11
Authors

Bill Weinman
Tech Advocate, Entrepreneur, Programming Expert
Course details
Perl is a powerful and flexible scripting language that is uniquely suited to website development, system administration, and network programming. Perl 5 was originally released in 1994, and continues to evolve. The "Modern Perl" movement has embraced its mature syntax and reusable modules. Bill Weinman has designed this course to give the Perl student enough command of the language to write efficient and effective Perl scripts and maintain existing codebases.
Watch to learn the details of the Perl syntax, from variables, conditionals, loops, and data structures to regular expressions, functions, and references. A quick-start guide is included for experienced developers who want to get up and running with Perl 5 fast, and the entire course is recommended for both new and experienced programmers alike. Later chapters cover file handling and reusing code with Perl modules, plus Perl best coding practices.
Learning objectives
Understanding Perl's general syntax and the anatomy of a Perl script
Writing statements and expressions
Creating assignments
Working with variables and strings
Using data types effectively
Defining logical flow with conditionals and loops
Using special variables
Using Perl operators
Performing simple Perl programming tasks with expressions
Matching data
Defining and calling functions
Using references
Handling files in the file I/O
Using built-in functions
Reusing code with modules
Coding with Perl best practices
Watch to learn the details of the Perl syntax, from variables, conditionals, loops, and data structures to regular expressions, functions, and references. A quick-start guide is included for experienced developers who want to get up and running with Perl 5 fast, and the entire course is recommended for both new and experienced programmers alike. Later chapters cover file handling and reusing code with Perl modules, plus Perl best coding practices.
Learning objectives
Understanding Perl's general syntax and the anatomy of a Perl script
Writing statements and expressions
Creating assignments
Working with variables and strings
Using data types effectively
Defining logical flow with conditionals and loops
Using special variables
Using Perl operators
Performing simple Perl programming tasks with expressions
Matching data
Defining and calling functions
Using references
Handling files in the file I/O
Using built-in functions
Reusing code with modules
Coding with Perl best practices
Skills covered
PerlEssential TrainingProgramming LanguagesOpen SourceSoftware Development
Concepts
Introduction
- Welcome
- Exercise files
Setting Up
- Installing Komodo for Mac OS X
- Installing Perl and Komodo for Windows
- About Perl
Quick Start
- About the quick start
- Hello World
- Counting lines in a file
- Loops and conditionals
- Functions
- Using perldoc
Basic Syntax
- Anatomy of a Perl script
- Statements and expressions
- Assignments
- Whitespace and comments
- Blocks and scope
Values and Variables
- Understanding values and variables
- Numeric variables
- Character strings
- Logical values
- Lists and arrays
- Slices of arrays
- Hashes or associative arrays
- Constants
Conditionals
- The if statement
- Else and elsif
- Negative conditionals with unless
- Switch with given and when
- The ternary conditional operator
Loops
- Understanding loops
- Loops with while and until
- Iterating with for
- Iterating with foreach
- Loop control statements
Special Variables
- The default variable
- Function arguments
- The autoflush variable
- The system error variable
- Other special variables
Operators
- About Perl's operators
- Basic arithmetic operators
- Compound assignment operators
- Relational operators
- Logical operators
- File test operators
- The range operator
- The string concatenation operator
- Quote operators
Regular Expressions
- About regular expressions
- Matching text
- Common modifiers
- Extracting matches
- Getting a list of matches
- Simple matches
- Matching wildcards
- Matching classes of characters
- Matching metacharacters
- Search and replace
- Splitting strings
Functions
- Understanding functions
- Defining and calling functions
- Calling a function with arguments
- Locally scoped variables
- Returning values
- Static variables
- Predeclared functions
References and Structures
- Understanding values and references
- Array references
- Hash references
- Function references
- Finding the type of a reference
- Mixed data structures
File I O
- Understanding streams and files
- Using file handles
- Using the OO interface for files
- Working with binary files
Built-In Functions
- The print() and say() functions
- The die() function
- String functions
- Numeric functions
- List and array functions
- Time functions
- The undef function
Modules
- Leveraging code with modules
- Perl's object model
- An example module
- Using Carp for error messages
Best Practices
- Be consistent
- Selective use of comments and whitespace
- Use strict and warnings
- Use constants
Conclusion
- Next steps