Prev: die

Twigils and special variables

Perl 6 has a large set of special variables. In order to make it easy to differentiate them from regular variables, they are marked with a second prefix called twigil.

Regular, user defined variables have a sigil ($, @ or %) in front of them.

System variables have and additional character between the sigil and the name of the variable.


  • $*PROGRAM_NAME contains the path to the currently running Perl 6 script.
  • $*CWD contains a path to the current working directory.
  • $*IN is the standard input (STDIN). You can read a line using $*IN.get
You can read more about them in S28

Prev: die

Table of Contents

Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.