Perl 6 Basics
In this tutorial, we will go through all the main features of Perl 6 such as variables, scopes, classes, regexes and control structures. Knowledge of Perl 5 is not required for working with this document, although it is assumed that you have basic understanding of what programming is.
All examples in the sections below can be run in place, modified as desired and tested again. Generally, the output of the examples does not present in the text to encourage you running tests :-)
- Basic control structures
- Variables and sigils
- Twigils
- Scope declarators
- Lexical variables
- Dynamic variables
- Basic types (strings, numbers)
- Basic file IO
- Basic OO
- Basic multi dispatch
- Basic regex support
- Subroutines
- Blocks
- Arrow blocks (lambdas)
- Placeholder blocks
- Special variables
- EVAL
- Constant declarations
- State variables
- Loops as list generators
- Labeled loops
Andrew Shitov,
andy@shitov.ru