Log In
Join
 for free
Log In
Join
 for free
Back To Course Home
Mastering Modern Perl: Writing Efficient and Maintainable Code
0% completed
Introduction to Modern Perl
Overview of the Course
Running Modern Perl
The Perl Philosophy
Perldoc
Expressivity
Context
Void, Scalar, and List Context
Numeric, String, and Boolean Context
Implicit Ideas: The Default Scalar Variable
Implicit Ideas: The Default Array Variables
Exercise: Remove a Newline Character
Solution: Remove a Newline Character
Quiz: Context and Implicit Ideas
Perl Identifiers and Variables
Identifiers
Variables
Values
Unicode and Strings
Implicit Conversions
Numbers
Lists
Exercise: Formatting Data
Solution Review: Formatting Data
Quiz: Data Types
Control Flow: Conditionals and Looping
Branching Directives: if, unless, else, elsif
The Ternary Conditional Operator
Conditional Directives and Context
Looping Directives: foreach, for
Iteration: Aliasing and Scoping
Looping Directives: The C-style for Loop
Looping Directives: while and until
Loops Within Loops
Loop Control: next, last, redo, continue
Switch Statements: given, when, default
Tailcall Optimization
Exercise: Find a Number in a List
Solution Review: Find a Number in a List
Exercise: Implement the Sieve of Eratosthenes
Solution Review: Implement the Sieve of Eratosthenes
Quiz: Control Flow
Data Structures
Scalars
Arrays
Array Operations and Slices
Context and Array Interpolation
Hashes
Hash Keys and Values
Hash Slices
Hash Idioms
Coercion
Exercise: Reverse a Hash
Solution Review: Reverse a Hash
Exercise: Occurrences of a Subarray in an Array
Solution Review: Occurrences of a Subarray in an Array
Quiz: Data Structures
Packages and References
Packages
Introduction to References
Types of References I
Types of References II
Nested Data Structures
References and Nested Data Structures
Exercise: Sum All Elements of a Nested Array
Solution: Sum All Elements of a Nested Array
Quiz: Packages and References
Operators
Operator Characteristics
Operator Types
Exercise: Make a Diamond
Solution Review: Make a Diamond
Quiz: Operators
Functions
Declaring and Invoking Functions
Function Parameters
Function Signatures
Manipulating Function Arguments
Functions and Namespaces
Reporting Errors
Advanced Functions
Pitfalls and Misfeatures
Types of Scope I
Types of Scope II
Anonymous Functions
Closures
State vs Closures and Pseudo-State
Attributes
AUTOLOAD
Drawbacks of AUTOLOAD
Exercise: Batch Calculator
Solution Review: Batch Calculator
Exercise: Writing an AUTOLOAD Function
Solution Review: Writing an AUTOLOAD() Function
Quiz: Functions
Regular Expressions and Matching
Introduction to Regular Expressions and Matching
Regex Operators
Quantifiers
Greediness
Regex Anchors
Metacharachters
Character Classes
Capturing
Grouping and Alternation
Other Escape Sequences and Assertions
Regex Modifiers
Smart Matching
Exercise: Extract Email Addresses
Solution Review: Extract Email Addresses
Exercise: Format Data
Solution Review: Format Data
Quiz: Regular Expressions and Matching
Objects
Introduction to Objects
Class and Methods
Class Attributes
Encapsulation
Polymorphism
Roles
Inheritance
Overriding Methods
Moose and Perl OO
Blessed References
Method Lookup and Inheritance
Reflection
Advanced OO Perl
Exercise: Implement Inheritance
Solution Review: Implement Inheritance
Quiz: Objects
Style and Efficacy
Programming Well in Perl
Writing Maintainable Perl
Writing Idiomatic Perl
Writing Effective Perl
Exceptions
Exception Caveats and Built-in Exceptions
Pragmas
Exercise: Exception Handling
Solution Review: Exception Handling
Quiz: Style and Efficacy
Managing Real Programs
Testing
Better Comparison and Organization of Tests
Handling Warnings
Opening Files
Reading and Writing to Files
Special File Handling Variables
Directories and Paths
File Manipulation
Modules
Distributions
The UNIVERSAL Package
Code Generations
Compile-time Manipulation
Overloading
Taint
Exercise: Sentence-wise Reversing a File
Solution Review: Sentence-wise Reversing a File
Quiz: Management of Real Programs
Perl Beyond Syntax
Idioms
Idioms: Part 2
Global Variables
Quiz: Perl Patterns and Idioms
What to Avoid
Barewords
Indirect Objects
Prototypes
Problems and Uses of Prototypes
Method-Function Equivalence
Tie
Quiz: What to Avoid
Perl and Its Community
Communities and Development Sites
The CPAN
CPAN installations
Next Steps with Perl
Useful Core Modules
What's Next?
Congratulations!
Appendix
Perl Testing Modules
Exceptions
Learn about exception handling in Perl.
We'll cover the following
Throwing exceptions
Catching exceptions
The eval operator
Check the caught exception
Drawback of matching string exceptions
Exception objects
Get hands-on with 1200+ tech skills courses.
Start Free Trial