Learn Perl 5. This course covers the basics of Perl scripting, using up-to-date "Modern Perl" standards.
Overview
Syllabus
Introduction
- Welcome
- Exercise files
- Installing Komodo for Mac OS X
- Installing Perl and Komodo for Windows
- About Perl
- About the quick start
- Hello World
- Counting lines in a file
- Loops and conditionals
- Functions
- Using perldoc
- Anatomy of a Perl script
- Statements and expressions
- Assignments
- Whitespace and comments
- Blocks and scope
- Understanding values and variables
- Numeric variables
- Character strings
- Logical values
- Lists and arrays
- Slices of arrays
- Hashes or associative arrays
- Constants
- The if statement
- Else and elsif
- Negative conditionals with unless
- Switch with given and when
- The ternary conditional operator
- Understanding loops
- Loops with while and until
- Iterating with for
- Iterating with foreach
- Loop control statements
- The default variable
- Function arguments
- The autoflush variable
- The system error variable
- Other special variables
- 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
- 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
- Understanding functions
- Defining and calling functions
- Calling a function with arguments
- Locally scoped variables
- Returning values
- Static variables
- Predeclared functions
- Understanding values and references
- Array references
- Hash references
- Function references
- Finding the type of a reference
- Mixed data structures
- Understanding streams and files
- Using file handles
- Using the OO interface for files
- Working with binary files
- The print() and say() functions
- The die() function
- String functions
- Numeric functions
- List and array functions
- Time functions
- The undef function
- Leveraging code with modules
- Perl's object model
- An example module
- Using Carp for error messages
- Be consistent
- Selective use of comments and whitespace
- Use strict and warnings
- Use constants
- Next steps
Taught by
Bill Weinman