Workshop: Migrating to Perl 6
- Duration
- 8 hours (with 3 breaks)
- Theoretical material is accomplished by a lot of exercices (both individual and in groups).
- People with Perl 5 experience
- Description
- This course is intended for the developers with Perl 5 background willing to start using Perl 6 in their practice. During the course, we will be transforming Perl 5 programs to Perl 6 with a strong focus on what happens at each step of the transformation. On a set of examples, we will also see what Perl 6 offers over Perl 5.
- Requirements
- Previous experience with Perl 5
- Laptop with internet
- Latest Rakudo Star installed (optional)
- Contents
- Introduction (1 hour)
- What is Perl 6?
- The Perl language family
- Naming concept
- Running Perl
- Compilers
- Command-line
- Loading modules
- Syntax check
- Looping with -n/-p
- Part 1. (3 hours)
- Type system
- Numeric literals
- String literals
- Variables
- Scalars
- Arrays
- Hashes
- Control flow
- Conditional checks
- if, unless, else
- Loops
- for loop
- Ranges
- Sequences
- Input and output
- Printing
- Formatting
- Working with files
- Subroutines
- Signatures
- Passing complex structures
- Default, optional, and named arguments
- Passing by value of 'by reference'
- Return values
- Multiple dispatch (multi-functions)
- Part 2 (2 hours)
- Regular expressions
- Matching texts
- Capturing and extracting data
- Character classes
- Built-in
- User-defined
- Unicode
- Support of UTF-8
- Unicode character properties
- Modules
- Creating a module
- Using a module
- Perl 6 ecosystem
- zef tool
- The Inline::Perl5 module
- Object-oriented programming
- Creating a class
- Class attributes
- Class methods
- Inheritance
- Roles
- Part 3 (2 hours)
- Error handling
- Try/catch blocks
- Handling error messages
- Error classes
- Internet
- Working with remote resources
- Working with databases
- Web server using Perl 6
- Special topics
- Compilation phases
- Phasers
- Pseudoconstants
- Parallel computing