© Moritz Lenz 2017

Moritz Lenz, Perl 6 Fundamentals , https://doi.org/10.1007/978-1-4842-2899-9_8

8. Review of the Perl 6 Basics

Moritz Lenz

(1)Fürth, Bayern, Germany

In the previous chapters, we discussed some examples interleaved with the Perl 6 mechanics that make them work. Here I want to summarize and deepen the Perl 6 knowledge that we’ve touched on so far, removed from the original examples.

8.1 Variables and Scoping

In Perl 6, variable names are made of a sigil, $, @, %, or &, followed by an identifier. The sigil implies a type constraint, where $ is the most general one (no restriction by default), @ is for arrays, % for hashes (associative arrays/maps), and & for code objects.

Identifiers can contain - and ' characters, as long as the character ...

Get Perl 6 Fundamentals : A Primer with Examples, Projects, and Case Studies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.