Glossary of Perl 6 terminology

Abstract Class

The generic Computer Science term "abstract class" defines the interface or API of a class. In Perl 6, this is implemented using roles with stubbed methods.

role Canine {
    method bark { ... }          # the ... indicates a stub 
class Dog does Canine {
    method bark { say "woof" }   # *MUST* be implemented by class 

Advent Calendar

In the context of Perl 6, a yearly set of blog posts for each day from the 1st until the 25th of December, to be found at


Generically, an adverb is a named argument to a function. There are also some specific syntax forms that allow adverbs to be tucked into some convenient places:

q:w"foo bar";   # ":w" is a Quotelike form modifier adverb 
m:g/a|b|c/;     # ":g" is also 

Adverbs are usually expressed with colon pair notation, and for this reason colon pair notation is also known as the adverbial pair form:

:a(4)          # Same as "a" => 4 

Some other forms that use a colon in ways that have adverb-like semantics are called adverbial forms. One special form starts with an integer value, followed by a name (for the key):

:20seconds     # same as seconds => 20 

Also see Colon Pair and Colon List.

Adverbial Pair

A generalized form of pair notation. They all start with the colon, like:

adverbial pair pair notation
:foo<bar> foo => 'bar'
:foo(42) foo => 42
:42foo foo => 42
:$foo foo => $foo
:foo foo => True
:!foo foo => False

Also see Adverb and Colon Pair and Colon List.


A type that has two related values which may be used depending on the context. For example IntStr allomorph is both an Int and a Str, so it will be accepted by anything that expects an Int, a Str, or an IntStr. Keep in mind that certain constructs, such as sets, bags, and mixes care about object identity, and so will not accept an allomorph as equivalent of its components alone.

The allomorph types IntStr, NumStr, RatStr and ComplexStr may be created as a result of parsing a quoted string:

say <42>.WHAT;     # OUTPUT: «(IntStr)␤» 
say <42.1e0>.WHAT# OUTPUT: «(NumStr)␤» 
say <42.1>.WHAT;   # OUTPUT: «(RatStr)␤» 

Note: angle brackets can also be used to create literals for which you'd normally need to use some operator (e.g. / for Rat or + for Complex). This allows you to use such literals in places where expressions are not allowed, for example, as literals in signatures:

    # Wrong, can't use an operator there: 
    mult foo (1/3{ say "It's one third!" }
    # Right, a Rat literal: 
    mult foo (<1/3>{ say "It's one third!" }

If you do want an allomorph and not a literal Numeric, then include whitespace around angle brackets:

say <42/1>.WHAT;   # OUTPUT: «(Rat)␤» 
say <42+0i>.WHAT;  # OUTPUT: «(Complex)␤» 
say < 42+0i >.WHAT;# OUTPUT: «(ComplexStr)␤» 
say < 42/1 >.WHAT# OUTPUT: «(RatStr)␤» 


A subroutine, method or submethod is called anonymous if it can't be called by name.

# named subroutine 
sub double($x{ 2 * $x };
# anonymous subroutine, stored in a named scalar 
my $double = sub ($x{ 2 * $x };

Note that it is still allowed to have a name, but you cannot call it by that name:

# anonymous, but knows its own name 
my $s = anon sub triple($x{ 3 * $x }
say $;        # OUTPUT: «triple␤» 
say triple(42);     # OUTPUT: «Undeclared routine: triple␤» 


Application Programming Interface. Ideally, someone using your system or library should be able to do so with knowledge only of the API, but not necessarily knowing anything about the internals or implementation.

See also Abstract Class.


A document originally written by TimToady, in which he processed the initial barrage of RFCs that came out of the Perl community. Now only kept as an historical document for reference. See also Exegesis and Synopsis.


The number of positional operands expected by an operator, subroutine, method or callable block.

sub infix:<+>(Foo $aFoo $b{ $a.Int + $b.Int }  # arity of "+" is 2 
sub frobnicate($x{ ... }                         # arity of 1 
sub the-answer() { 42 }                            # arity of 0 
-> $key$value { ... }                            # arity of 2 

The arity of a Callable is one of the main selectors in multi-dispatch.


Autothreading is what happens if you pass a Junction to a subroutine that expects a parameter of type Any or a subtype thereof (such as anything Cool). The call is then executed for each value of the junction. The result of these calls is assembled in a new junction of the same type as the original junction.

sub f($x{ 2 * $x };
say f(1|2|3) == 4;    # OUTPUT: «any(False, True, False)␤» 

Here f() is a sub with one parameter, and since it has no explicit type, it is implicitly typed as Any. The Junction argument causes the f(1|2|3) call to be internally executed as f(1)|f(2)|f(3), and the resulting junction is 2|4|6. These are then all compared to 4, resulting in a junction False|True|False. This process of separating junction arguments into multiple calls to a function is called autothreading.

If you use the resulting junction in a boolean context, such as with an if, it collapses into a single boolean which is True if any of the values in the junction are True.

    if f(1|2|3) == 4 {    # fires because f(2) == 4 is true 
        say 'success';




A butterfly image intended primarily to represent Perl 6, The Language.

Colon Pair and Colon List

A colon pair is a shorthand syntax used to create or visually present a Pair object. The two most common forms are:

:a(4)          # Same as "a" => 4,   same as"a", 4) 
:a<4>          # Same as "a" => "4", same as"a", "4") 

This is also known as the adverbial pair form. Note: when the part after the colon and before the brackets is not a legal identifier, other semantics apply, not all of which produce Pair objects.

Two other common forms are:

:a             # Same as :a(True) 
:!a            # Same as :a(False) 

A colon list just means that a list that contains only colon pairs, does not need commas, or even spaces:

:a(4):c:!d:c   # Same as a => 4, c => True, d => False, c => True 

Finally, if there is a variable with the same name as an intended adverbial pair, you don't have to specify the name twice, but just specify the adverb with the appropriate sigil:

:$foo          # same as foo => $foo 
:@bar          # same as bar => @bar 
:%mapper       # same as mapper => %mapper 
:&test         # same as test => &test 

See also Adverb.

Damian Conway

Original author of the Exegesis (among many other things). See also


See operator. It means the type of the operator result is sufficiently different from its arguments that op= makes little sense


A document originally written by TheDamian, in which he tried to explain the Apocalypses to the common (wo)man. Now only kept as an historical document for reference. See also Synopsis.


Too complicated to apply a meta-op to. See operator.


Often used as a boolean value. See operator.


An instance of a class is also called an object in some other programming languages. It has storage for attributes and is often the return value of a call to a method called new, or a literal.

Instances of most types are defined to be True e.g., defined($instance) is True.

my Str $str = "hello";  ## this is with builtin types, e.g. Str 
if defined($str{
    say "Oh, yeah. I'm defined.";
else {
    say "No. Something off? ";
## if you wanted objects... 
class A {
    # nothing here for now. 
my $an_instance =;
say $an_instance.defined.perl;# defined($an_instance) works too. 

To put things another way, a class contains the blueprints of methods and attributes, and an instance carries it into the real world.


An interface is an abstract class.


Internet Relay Chat. Perl 6 developers and users usually hang out on the #perl6 channel of Currently available bots are:


The Bot on the #perl6 IRC channel that evaluates code, e.g.:

[16:28:27]  <lizmat>  m: say "Hello world"
[16:28:28]  <+camelia>    rakudo-moar 812a48: OUTPUT«Hello world␤»

This is a handy tool for showing people if the output is (un)expected.


The Bot on the #perl6 IRC channel that reports changes made to various Perl 6 related repositories.

[15:46:40] <+dalek> doc: 2819f25 | lizmat++ | doc/Language/glossary.pod:
[15:46:40] <+dalek> doc: Add stubs for stuff inside the glossary already
[15:46:40] <+dalek> doc: review:


The Bot on the #perl6 IRC channel that provides various services to people logged in. Commands to yoleaux (a pun on YOLO) start with a period. Some often used commands are:


Leave a message to another user who is currently not logged in. The message will be relayed as soon as the user says anything on the channel.

.tell lizmat I've read the glossary


Look up unicode codepoint information from either a codepoint, or the name of a codepoint.

[16:35:44]  <lizmat>   .u empty set
[16:35:45]  <yoleaux>  U+2205 EMPTY SET [Sm] (∅)
[16:36:29]  <lizmat>   .u ∅
[16:36:30]  <yoleaux>  U+2205 EMPTY SET [Sm] (∅)

Some IRC clients then easily allow you to copy/paste the codepoint in question, which can be sometimes be easier than other unicode codepoint input methods.

IRC Lingo

The following terms are often used on the Perl 6 related IRC channels:


As Late As Possible


A self-referencing pun, e.g. "Are you ignorant or apathetic?" - "I don't know, and I don't care."


That part of a discussion on an IRC channel that you've missed. If it is not or no longer available in your IRC client, you can go to sites such as to see what has been logged for you.


A program that does automatic tasks on one or more IRC channels by acting like a regular user (as far as the IRC server is concerned) and performing some tasks that may involve answering to users requests. Examples are camelia, dalek and yoleaux.


Do What I Mean. A programming language designer motto.


Sometimes a test will fail under some conditions, but not others; when this test passes some test runs and fails others, it's called flapping.


Something in a generally current document that is no longer true but which has not yet been fixed by correcting or removing it.


For Some Value Of...


Fixed That For You


It Would Be Nice


Low Hanging Fruit. Usually used in the context of a (relatively) simple task to be performed by a (relative) newbie.


Less Than Awesome. Usually used in the context of an error message that is rather non-descriptive or unrelated to the actual error.


No Such Thing


Short for "optimization", usually in either the context of spesh or JIT.


Short for "problem". As in "that's not the pb".


"Perl Best Practices". The book by Damian Conway outlining best practices when programming Perl 5.


See Pull Request.


Perl 5


Perl 6


Real Soon Now


Request Tracker ( The place where all the bugs related to Rakudo live.


An alternative form of TMTOWTDI, explicitly including the "is" from the contraction "There's".


Too Much Information.


"There's More Than One Way To Do It", the Perl motto.


"Universal Greeting Time" - i.e., it's always "morning".


Works For Me


Work In Progress




Short for wrong window. When on IRC, someone types something in a channel that was intended for another channel, or for a private message.

Larry Wall

Perl's benevolent dictator for life, among many other things. See also



A literal is a piece of code that directly stands for an (often built-in) object and also refers to the object itself.

my $x = 2;      # the 2 is a literal 
say $x;         # $x is not a literal, but a variable 
my $s = "Foo";  # the "Foo" is a literal, the $s is a variable 


An lvalue, or a left value, is anything that can appear on the left hand side of the assignment operator =. It is anything you can assign to.

Typical lvalues are variables, private and is rw attributes, lists of variables and lvalue subroutines.

Examples of lvalues:

Declaration lvalue Comments
my $x; $x
my ($a, $b); ($a, $b)
has $!attribute; $!attribute Only inside classes
has $.attrib is rw; $.attrib
sub a is rw { $x }; a()

Examples of things that are not lvalues:

3 literals
constant x = 3; constants
has $.attrib; attributes; you can only assign to $!attrib
sub f { }; f(); "normal" subs are not writable
sub f($x) { $x = 3 }; error - parameters are read-only by default

These are typically called rvalues.


The mainline is the program text that is not part of any kind of block.

use v6.c;     # mainline 
sub f {
              # not in mainline, in sub f 
f();          # in mainline again 

You can also have the mainline of any package-like declarator, such as class, module, grammar, etc. These are typically run just after the class/module/grammar have been compiled (or when loaded from a pre-compiled file).


MoarVM is short for Metamodel On A Runtime Virtual Machine. It's a virtual machine designed specifically for NQP and its MOP: 6model. A document about the purpose of MoarVM. MoarVM has some similarities with the Hotspot VM so you may peruse its glossary for entries missing from the present one.


The process of picking a candidate for calling of a set of methods or subs that come by the same name but with different arguments. The most narrow candidate wins. In case of an ambiguity, a routine with is default trait will be chosen if one exists, otherwise an exception is thrown.


A method that has multiple candidates going by the same name and are subject to Multi-Dispatch.


An implementation of Perl 6 targeting the .NET platform. No longer actively maintained.

Not Quite Perl

See NQP.


NQP is a primitive language for writing subroutines and methods using a subset of the Perl 6 syntax. It's not intended to be a full-fledged programming language, nor does it provide a runtime environment beyond the basic VM primitives. Compilers (such as Rakudo typically use NQP to compile action methods that convert a parse tree into its equivalent abstract syntax tree representation.


Not Yet Implemented



An expression is made of operators and operands. More precisely it is made of an operator and operands that can be subexpressions or values. Operators are an alternative syntax for a multi-method. With that syntax, what would be the arguments of the function are named operands instead. Operators are classified into categories of categories. A category has a precedence, an arity, and can be fiddly, iffy, diffy. Perl 6 is very creative as to what is an operator, so there are many categories. Operators are made of many tokens, possibly with a subexpression. For example, @a[0] belongs to the postcircumfix category, is broken into the operand @a and the postcircumfix operator [0] where 0 is the postcircumfixed subexpression.

The <O(I<...>)> construction gives information about an operator that completes the information provided by its category. Below %conditional is the category, :reducecheck<ternary> , which specifies calling .ternary to post-process the parse subtree and :pasttype<if> specifies the NQP opcode generated in the AST from the parse subtree.

<O('%conditional, :reducecheck<ternary>, :pasttype<if>')>

Parse Tree


Parameter is a class to define parameters to subroutines, method and a callable blocks. As opposed to the arguments you specify when calling a subroutine/method/callable block.

sub foo($bar{ say $bar }     # $bar is a parameter 
foo(42);                       # 42 is an argument 


A virtual machine designed to run Perl 6 and other dynamic languages. No longer actively maintained.


Parrot AST.


Name of the Perl 5 executor.


The Perl programming language in its many forms.


A way to describe Perl as a language, considered to be improper by many in the Perl Community.


Plain Ol' Documentation, a documentation format understood by Perl 6. See S26 for details.

Pull Request

A feature of that allows you to make patches to be easily applied using the Github user interface. It means you request someone to do a git pull from your repository to hers. In GitHub, it can be done automatically through the web interface. PR is its usual acronym.


pugs was one of the first interpreters/compilers written for Perl 6. It was written in Haskell by Audrey Tang.


Successor to PAST ('Q' being the next letter after 'P').


Rakudo is the name of a Perl 6 implementation that runs on MoarVM and the JVM. It is an abbreviation of Rakuda-do, which, when translated from Japanese, means "The Way of the Camel". Also, in Japanese, "Rakudo" means "Paradise."


In English language, reify means to "to convert into or regard as a concrete thing." Its meaning in Perl 6 is very similar, in that conceptual things, like "elements of an infinite list" get reified when you try to operate on some of them:

# A list containing infinite number of un-reified Fibonacci numbers: 
my @fibonacci = 11* + * … ∞;
# We reify 10 of them, looking up the first 10 of them with array index: 
say @fibonacci[^10]; # OUTPUT: «(1 1 2 3 5 8 13 21 34 55)␤» 
# We reify 5 more: 10 we already reified on previous line, and we need to 
# reify 5 more to get the 15th element at index 14. Even though we need only 
# the 15th element, the original Seq still has to reify all previous elements: 
say @fibonacci[14]; # OUTPUT: «987␤» 

Above we were reifying a Seq we created with the sequence operator, but other things use the concept as well. For example, an un-reified Range is just the two end points. In some languages, calculating the sum of a huge range is a lengthy and memory-consuming process, but Perl 6 calculates it instantly:

say sum 1 ..9_999_999_999_999# OUTPUT: «49999999999995000000000000␤» 

Why? Because the sum can be calculated without reifying the Range; that is without figuring out all the elements it contains. This is why this feature exists. You can even make your own things you can reify-on-demand, using gather and take:

my $seq = gather {
    say "About to make 1st element"take 1;
    say "About to make 2nd element"take 2;
say "Let's reify an element!";
say $seq[0];
say "Let's reify more!";
say $seq[1];
say "Both are reified now!";
say $seq[^2];
# Let's reify an element! 
# About to make 1st element 
# 1 
# Let's reify more! 
# About to make 2nd element 
# 2 
# Both are reified now! 
# (1 2) 

Following the output above, you can see the print statements inside the gather got printed only when we reified the individual elements while looking up an element. Also note, the elements got reified just once. When we printed the same elements again on the last line of the example, the messages inside gather we no longer printed. This is because the construct used already-reified elements from the Seq's cache.

Note that above we assigned the gather to a Scalar container (the $ sigil), not the Positional one (the @ sigil). The reason is that the @-sigiled variables are mostly lazy. What this means is they reify the stuff assigned to them right away most of the time. The only time they don't do it is when the items are known to be is-lazy, like our sequence generated with infinity as the end point. Were we to assign the gather to a @-variable, the say statements inside of it would've been printed right away.

Another way to fully-reify a list, is by calling .elems on it. This is the reason why checking whether a list contains any items is best done by using .Bool method (or just using if @array { … }), since you don't need to reify all the elements to find out if there are any of them.

There are times where you do want to fully-reify a list before doing something. For example, the IO::Handle.lines returns a Seq. The following code contains a bug; keeping reification in mind, try to spot it:

    my $fh = "/tmp/bar";
    my $lines = $fh.lines;
    close $fh;
    say $lines[0];

We open a file handle, then assign return of .lines to a Scalar variable, so the returned Seq does not get reified right away. We then close the file handle, and try to print an element from $lines.

The bug in the code is by the time we reify the $lines Seq on the last line, we've already closed the file handle. When the Seq's iterator tries to generate the item we've requested, it results in the error about attempting to read from a closed handle. So, to fix the bug we can either assign to a @-sigiled variable or call .elems on $lines before closing the handle:

    my $fh = "/tmp/bar";
    my @lines = $fh.lines;
    close $fh;
    say @lines[0]; # no problem! 

Also good:

    my $fh = "/tmp/bar";
    my $lines = $fh.lines;
    say "Read $lines.elems() lines"#reifying before closing handle 
    close $fh;
    say $lines[0]; # no problem! 


A filesystem under control of a source control management application, usually git, that holds the sources for a project, library or application. This file, for instance, is in a GitHub repository. Repositories store not only files, but also history of changes and can be used by the developing or writing team for interaction through issues or comments to code.


The Perl 6 specification tests, which live here: Originally developed for pugs, it now serves all Perl 6 implementations. Why roast? It's the repository of all spec tests.


(Used in regular expressions)


A value that can be used on the right hand side of an assignment. See also lvalue.


In Perl, the sigil is the first character of a variable name. It must be either $, @, %, or & respectively for a scalar, array, hash, or code variable. See also Twigil and role. Also sigiled variables allow short conventions for variable interpolation in a double quoted string, or even postcircumfix expressions starting with such a variable.

Sigilless Variable


A functionality of the MoarVM platform that uses run-time gathered data to improve commonly used pieces of bytecode. It is much like a JIT compiler, except that those usually output machine code rather than bytecode.

STD is the "standard" Perl 6 grammar definition, see that was used to implement Perl 6. is no longer really a "specification" in a proscriptive sense: it's more of a guideline or model for Perl 6 implementations to follow.



Fancy alternative way to denote a name. Generally used in the context of modules linking, be it in the OS level, or at the Perl 6 Virtual Machine level for modules generated from languages targeting these VMs. The set of imported or exported symbols is called the symbol table.


The current human-readable description of the Perl 6 language. Still in development. Much more a community effort than the Apocalypses and Exegeses were. The current state of the language is reflected by roast, its test suite, not the synopses where speculative material is not always so flagged or more recent additions have not been documented. This is even more true of material that has not been yet implemented.

Syntax Analysis

test suite

The Perl 6 test suite is roast

Texas operator

The ASCII variant of a non-ASCII Unicode operator or symbol. So described because "Everything's bigger in Texas." For instance, (elem) corresponds to the ("Is this an element of that set?") operator that comes from set theory. Texas operators are a workaround to the problem that people don't know how to type Unicode yet. Culturally, while we encourage people to use the Unicode symbols in a vague sort of way, we do not disparage the use of the ASCII variants. Well, maybe just a little...


IRC screen name for Damian Conway, writer of the original Exegeses.


IRC screen name for Larry Wall, creator of Perl. The name comes from the pronunciation of TIMTOWTDI as a word.


A piece of code that isn't immediately executed, but doesn't have an independent scope.


Value type

A type is known as a value type if it is immutable and any instance of that type is interchangeable with any other instance "of the same value"—that is, any instance constructed in the same way. An instance of a value type is often called a value (but should not be confused with lvalues or rvalues).

For example, numbers are value types, so a number constructed one place in your program with, for instance, the literal 3 can't be changed in any way—it simply is 3—and any later use of the literal 3 can safely be pointed at the same place in memory as the first with no ill consequences.

Classes doing the roles Numeric and Stringy are among a few examples of built-in value types.

A value type is created by ensuring that an instance of the value type is immutable (i.e., its attributes cannot be modified after construction) and that its WHICH method returns the same thing every time an instance with the same value is constructed (and conversely returns a different thing every time an instance with a different value is constructed).

The language is free to optimize based on the assumption that equivalent instances of value types are interchangeable, but you should not depend on any such optimization. For instance, if you want clone to return an instance of self, or you want instance construction to be memoized so that re-construction of a previously-constructed value always returns the same instance, you currently must override this behavior yourself.

(The same would hold true of object finalization, but if your instances need special destruction behavior, you almost certainly do not actually have a value type. Values should be thought of as "timeless" and existing in some ideal form outside of your program's memory, like natural values are.)


A variable is a name for a container.

Variable Interpolation

Virtual Machine

A virtual machine is the Perl compiler entity that executes the bytecode. It can optimize the bytecode or generate machine code Just in Time. Examples are MoarVM, Parrot (who are intended to run Perl 6) and more generic virtual machines such as JVM and Javascript.