Search Page
ErrorsCollection

Search Page

Search the Website

Table of Contents
Web page (clickable)
Chapter headings (clickable)
Raku™ by example 101 Pragma v6 Statements Lexical scope and block Sigils and identifiers Scalar Filehandle and assignment String literals Arrays, methods and invocants Hashes for and blocks Any and += Fat arrow, pairs and autovivification Postincrement and preincrement Topic variable Blocks Stable sort Standard output Variable interpolation Double-quoted strings and single-quoted strings Zen slices Exercises Perl to Raku guide - in a nutshell CPAN Syntax Identifiers -> Method calls Whitespace Sigils $ Scalar @ Array % Hash & Sub * Glob [] Array indexing/slicing {} Hash indexing/slicing Creating references and using them Operators , (Comma) List separator <=> cmp Three-way comparisons ~~ Smartmatch operator & | ^ String bitwise ops & | ^ Numeric bitwise ops & | ^ Boolean ops << >> Numeric shift left|right ops => Fat comma ? : Ternary operator . (Dot) String concatenation x List repetition or string repetition operator .. ... Two dots or three dots, range op or flipflop op String interpolation Compound statements Conditionals if elsif else unless given-when Loops while until do while/until for foreach each Flow control statements continue Functions Built-ins with bare blocks delete exists Regular expressions ( regex / regexp ) Change =~ and !~ to ~~ and !~~ . Captures start with 0, not 1 Move modifiers Add :P5 or :Perl5 adverb Special matchers generally fall under the <> syntax Longest token matching (LTM) displaces alternation Named captures Comments BEGIN, UNITCHECK, CHECK, INIT and END UNITCHECK becomes CHECK No block necessary Changed semantics with regards to precompilation Pragmas strict warnings autodie base, parent bigint bignum bigrat constant encoding integer lib mro utf8 vars Command-line flags -a -F -l -M -m -E -d, -dt, -d:foo, -D, etc. -s File-related operations Reading the lines of a text file into an array Capturing the standard output of executables. Environment variables Perl module library path Misc. '0' is True dump AUTOLOAD Importing specific functions from a module Importing groups of specific functions from a module Core modules Data::Dumper Getopt::Long Automated translation Blue Tiger Perlito Perl-ToPerl6 Other sources of translation knowledge Perl to Raku guide - overview Raku in a nutshell Syntactic differences Operators in Raku Functions in Raku Special variables in Raku Perl to Raku guide - functions DESCRIPTION NOTE Alphabetical listing of Perl functions Filetests abs accept alarm atan2 bind binmode bless break caller chdir chmod chomp chop chr chroot close closedir connect continue cos crypt dbm functions defined delete die do dump each eof eval evalbytes exec exists exit exp fc fcntl __FILE__ fileno flock fork formats getc getpeername getpgrp getppid getpriority get and set functions getsock* glob gmtime goto grep hex import index int ioctl join keys kill last lc lcfirst length __LINE__ link listen local localtime lock log lstat m// map mkdir msg* my next no oct open opendir ord our pack package __PACKAGE__ pipe pop pos print printf prototype push quoting rand read readdir readline readlink readpipe recv redo ref rename requires reset return reverse rewinddir rindex rmdir s/// say scalar seek seekdir select semctl semget semop send setpgrp setpriority setsockopt shift shm* shutdown sin sleep sockets sort splice split sprintf sqrt srand stat state study sub __SUB__ substr symlink syscall sys* system syswrite tell telldir tie time times tr/// truncate uc ucfirst undef unlink unpack unshift untie use utime values vec wait waitpid wantarray warn write y/// Perl to Raku guide - operators DESCRIPTION NOTE Operator precedence and associativity Terms and list operators The arrow operator Auto-increment and auto-decrement Exponentiation Symbolic unary operators Binding operators Multiplicative operators Additive operators Shift operators Named unary operators Relational operators Equality operators Smartmatch operator Bitwise And Bitwise Or and Exclusive Or C-style Logical And C-style Logical Or Logical Defined-Or Range operators Conditional operator Assignment operators Comma operator List operators (rightward) Logical Not Logical And Logical or and Exclusive Or Quote and quote-like operators I/O operators No-ops Bitwise string operators Perl to Raku guide - syntax DESCRIPTION NOTE Free form Declarations Comments Truth and falsehood Statement modifiers Compound statements Loop control For loops Foreach loops Switch statements Goto Ellipsis statement PODs: embedded documentation Perl to Raku guide - special variables DESCRIPTION NOTE SPECIAL VARIABLES General variables $ARG, $_ @ARG, @_ $LIST_SEPARATOR, $" $PROCESS_ID, $PID, $$ $PROGRAM_NAME, $0 $REAL_GROUP_ID, $GID, $( $EFFECTIVE_GROUP_ID, $EGID, $) $REAL_USER_ID, $UID, $< $EFFECTIVE_USER_ID, $EUID, $> $SUBSCRIPT_SEPARATOR, $SUBSEP, $; $a, $b %ENV $OLD_PERL_VERSION, $] $SYSTEM_FD_MAX, $^F @F @INC %INC $INPLACE_EDIT, $^I $^M $OSNAME, $^O %SIG $BASETIME, $^T $PERL_VERSION, $^V ${^WIN32_SLOPPY_STAT} $EXECUTABLE_NAME, $^X Variables related to regular expressions Performance issues $ ($1, $2, ...) $MATCH, $& ${^MATCH} $PREMATCH, $` ${^PREMATCH} $POSTMATCH, $' ${^POSTMATCH} $LAST_PAREN_MATCH, $+ $LAST_SUBMATCH_RESULT, $^N @LAST_MATCH_END, @+ %LAST_PAREN_MATCH, %+ @LAST_MATCH_START, @- %LAST_MATCH_START, %- $LAST_REGEXP_CODE_RESULT, $^R ${^RE_DEBUG_FLAGS} ${^RE_TRIE_MAXBUF} Variables related to filehandles $ARGV @ARGV ARGV ARGVOUT $OUTPUT_FIELD_SEPARATOR, $OFS, $, $INPUT_LINE_NUMBER $NR, $. $INPUT_RECORD_SEPARATOR, $RS, $/ $OUTPUT_RECORD_SEPARATOR, $ORS, $\ $OUTPUT_AUTOFLUSH, $| ${^LAST_FH} Variables related to formats Error variables Variables related to the interpreter state $COMPILING, $^C, $^D, ${^ENCODING}, ${^GLOBAL_PHASE} $^H, %^H, ${^OPEN} $PERLDB, $^P ${^TAINT} ${^UNICODE}, ${^UTF8CACHE}, ${^UTF8LOCALE} About the docs Structure Generating HTML from Pod Contributing Adding definitions Classes and objects A quick overview The Task example Class Attributes Twigil $! Twigil $. is rw trait is built trait is required trait Default values Class variables Methods Private methods Construction bless TWEAK BUILD Destruction Consuming our class A word on types Inheritance Overriding inherited methods Multiple inheritance The also declarator Introspection Overriding default gist method A practical introspection example Community Overview The Raku community Online communities Offline communities Other resources Rakudo Weekly Raku Advent calendar CompUnits and where to find them Overview Introduction Why change? Long names $*REPO Repositories Resources Dependencies Precomp stores Credit Concurrency High-level APIs Promises Supplies whenever react Transforming supplies Ending a supply Phasers in a supply or react block Channels Proc::Async Low-level APIs Threads Schedulers ThreadPoolScheduler CurrentThreadScheduler Locks Safety concerns Containers What is a variable? Scalar containers Callable containers Binding Scalar containers and listy things Assigning and binding to array variables Binding to array elements Flattening, items and containers Self-referential data Type constraints Definedness constraints Custom containers Contexts and contextualizers Sink Number String Boolean List Item context Control flow Statements Blocks Phasers do start if else/elsif unless with orwith without when for gather/take supply/emit given default and when proceed and succeed given as a statement loop while, until repeat/while, repeat/until return return-rw fail once LABELs next last redo Command line interface Command line interface - an overview Parsing the command line parameters into a capture Calling a provided MAIN subroutine using that capture Creating / showing usage information if calling MAIN failed sub MAIN %*SUB-MAIN-OPTS named-anywhere bundling is hidden-from-USAGE Unit-scoped definition of MAIN sub USAGE Intercepting CLI argument parsing (2018.10, v6.d and later) sub ARGS-TO-CAPTURE Intercepting usage message generation (2018.10, v6.d and later) sub RUN-MAIN sub GENERATE-USAGE Intercepting MAIN calling (before 2018.10, v6.e) Enumeration Exceptions Ad hoc exceptions Typed exceptions Catching exceptions Exception handlers and enclosing blocks try blocks Throwing exceptions Resuming of exceptions Uncaught exceptions Control exceptions Experimental features pack macros cached FAQ General What's the difference between Raku, Rakudo and Perl 6? When was Raku released? Is there a Raku version 6.0.0? When was v6.d released? As a Raku user, what should I install? As an advanced user I want to track Rakudo development. Where can I find good documentation on Raku? Can I get some books about Raku? What is the Raku specification? Is there a glossary of Raku related terms? I'm a Perl programmer. Where is a list of differences between Perl and Raku? I'm a Ruby programmer looking for quickstart type docs? Modules Is there a repository of third party library modules for Raku? Is there a perldoc (command line documentation viewer) for Raku? Can I use Perl modules from Raku? Can I use C and C++ from Raku? Nativecall can't find libfoo.so and I only have libfoo.so.1.2! Where have all the traditional UNIX library functions gone? Does Rakudo have a core standard library? Is there something like B::Deparse/How can I get hold of the AST? What is precompilation? Can I have circular dependencies between modules? Common operations String: How can I parse and get a number from a string? String: How can I check if a string contains a substring and if so, how can I get indices of matches? String: How can I get the hexadecimal representation of a string? String: How can I remove from a string some characters by index? String: How can I split a string in equal parts? Language features How can I dump Raku data structures (like Perl Data::Dumper and similar)? How can I get command line history in the Raku prompt (REPL)? Why is the Rakudo compiler so apologetic? What is (Any)? What is so? What are those :D and :U things in signatures? What is the --> thing in the signature? How can I extract the values from a Junction? If Str is immutable, how does s/// work? If Int is immutable, how does $i++ work? What's up with array references and automatic dereferencing? Do I need the @ sigil? Why sigils? Couldn't you do without them? "Type Str does not support associative indexing." Does Raku have coroutines? What about yield? Why can't I initialize private attributes from the new method, and how can I fix this? How and why do say, put and print differ? What's the difference between token and rule ? What's the difference between die and fail? What's the difference between Pointer and OpaquePointer? You can have colonpairs in identifiers. What's the justification? How do most people enter unicode characters? Raku implementation What Raku implementations are available? What language is Rakudo written in? What language is NQP written in? Is Raku Lisp? Can I compile my script to a standalone executable? Raku distribution When will the next version of Rakudo Star be released? Metaquestions and advocacy Why was Raku originally called Perl 6? When will Raku be ready? Is it ready now? Why should I learn Raku? What's so great about it? Is Raku fast enough for me? Filename extensions Introduction History and extensions Functions Defining/Creating/Using functions Subroutines Blocks and lambdas Signatures Automatic signatures Arguments Return values Return type constraints Multi-dispatch proto only multi resolution by order of definition Conventions and idioms Slurpy conventions Functions are first-class objects Infix form Closures Routines Defining operators Precedence Associativity Traits Re-dispatching sub callsame sub callwith sub nextsame sub nextwith sub samewith sub nextcallee Wrapped routines Routines of parent class Coercion types sub MAIN Glossary Abstract class Advent calendar Adverb Adverbial pair Allomorph Anonymous API Apocalypse Arity ASCII operator Autothreading Backtracking binder block bytecode Camelia Colon pair and colon list Community Damian Conway decont diffy Exegesis Forward declarations fiddly Handle Huffmanize iffy import Instance Interface Invocant IRC IRC lingo ALAP autopun backlog Bot Compilation unit or compunit DWIM flap fossil FSVO FTFY gradual typing IIRC IMHO IWBN LHF LGTM LTA NST Opt PB PR P5 P6 RSN RT TIMTOWTDI TMI TMTOWTDI UGT WFM WIP WP WW Larry Wall Lexing Literal LHS lvalue Mainline Mayspec MoarVM Multi-dispatch multi-method Née NFG Niecza Not Quite Perl NQP NYI opcode Operator Parse tree Parameter Parrot PAST Perl Perl 6 PERL POD POV Propspec Pull request property pugs QAST Rakudo Reify Repository RHS roast Roles rvalue SAP Semilist Sigil Sigilless variable Spesh STD Stub Symbol Synopsis Syntax analysis Test suite TheDamian TimToady token Thunk Tight and loose precedence twine Type objects Type smiley value UB Value type Variable Variable interpolation Virtual machine WAT whitespace 6model Grammar tutorial Before we start Why grammars? When would I use grammars? The broad concept of grammars Getting more technical The conceptual overview The technical overview Learning by example - a REST contrivance Adding some flexibility Inheriting from a grammar Adding some constraints Putting our RESTful grammar together Grammar actions Grammars by example with actions Keeping grammars with actions tidy with make and made Add actions directly Grammars Named Regexes Rules Creating grammars Proto regexes Special tokens TOP ws sym "Always succeed" assertion Methods in grammars Dynamic variables in grammars Attributes in grammars Passing arguments into grammars Action objects Hashes and maps The associative role and associative classes Mutable hashes and immutable maps Hash assignment Hash slices Non-string keys (object hash) Constraint value types Looping over hash keys and values In place editing of values Haskell to Raku - nutshell Types Types vs values Maybe Data definitions Type aliases and subsets Typeclasses Functions Definitions and signatures Pattern Guards Argument Currying Composing Case / matching Lists List comprehensions Fold takeWhile Map Ranges Laziness vs eagerness Contexts (let-in / where) Parsers Parser combinators vs grammars Tail Call Optimization or Tail Call Elimination Brief introduction Input/Output Reading from files Line by line Writing to files Copying, renaming, and removing files Checking files and directories Getting a directory listing Creating and removing directories Input/Output the definitive guide The basics Navigating paths What's an IO::Path anyway? Path parts Working with files Writing into files Writing new content Appending content Reading from files Using IO::Path Using IO::Handle The wrong way to do things Leave $*SPEC alone Stringifying IO::Path Be mindful of $*CWD temp the $*CWD Inter-process communication Running programs The Proc object The Proc::Async object Iterating The Iterator and Iterable roles How to iterate: contextualizing and topic variables Classic loops and why we do not like them JavaScript (Node.js) to Raku - nutshell Basic syntax "Hello, world!" Variables Operators Assignment Equality Smartmatching Numeric Bitwise Checking for definedness Custom operators and operator overloading Control flow if/else switch for, while, and do/while do Types Creating types Using types Comparing JavaScript and Raku types Functions Object-oriented programming Asynchronous programming The networking API Net HTTP/HTTPS DNS Punycode The filesystem API Modules and packages Lists, sequences, and arrays Literal lists The @ sigil Reset a list container Iteration Single Argument Rule Testing for elements Sequences Using .iterator Slips Lazy lists Immutability List contexts List assignment context Flattening "context" Argument list (Capture) context Slice indexing context Range as slice Array constructor context Arrays Typing Fixed size arrays Itemization Literal arrays Mutability Assigning Binding Doing math with Raku Sets Arithmetic Sequences Mathematical constants Numerical integration of ordinary differential equations Requirements Malthus model Step by step explanation Logistic model Strong Allee Effect Weak Allee Effect Extra info Module packages What are modules? When to use modules Working with modules Modules on disk File and module naming The unit keyword What happens if I omit module? Lexical aliasing and safety Modules Creating and using modules Looking for and installing modules. Basic structure Loading and basic importing need use require Lexical module loading Exporting and selective importing is export UNIT::EXPORT::* EXPORT Introspection Finding installed modules Testing modules and a distribution Distributing modules Preparing the module Upload your module to CPAN Upload your module to zef ecosystem Versioning and fez Upload your module to p6c Modules and tools related to module authoring Contact information Core modules CompUnit::* modules and roles NativeCall modules Other modules Module development utilities Module builder and authoring tools Tests NativeCall Sample modules Metaobject protocol (MOP) Metamethods WHAT WHICH WHO WHERE HOW WHY DEFINITE VAR Metaclass methods Structure of the metaobject system Bootstrapping concerns Composition time and static reasoning Power and responsibility Power, convenience and pitfalls Native calling interface Getting started NativeCall helper module Changing names Passing and returning values Specifying the native representation Basic use of pointers Function pointers Arrays CArray methods CArray sub-arrays Structs CUnions Embedding CStructs and CUnions with HAS Notes on memory management In your Raku code... In your C code... Typed pointers Strings Explicit memory management Buffers and blobs Function arguments Library paths and names ABI/API version Routine Calling into the standard library Exported variables C++ support Helper functions sub nativecast sub cglobal sub nativesizeof sub explicitly-manage Examples PostgreSQL MySQL Microsoft Windows Short tutorial on calling a C function Platform Specific Notes MacOS - DYLD_LIBRARY_PATH is ignored Raku native types Types with native representation Types with native representation and size The void type Atomic types Rakudo specific native types Newline handling in Raku Numerics Int Num Complex Rational Rat Degradation to Num FatRat Printing rationals Division by zero Zero-denominator rationals Allomorphs Available allomorphs Coercion of allomorphs Object identity Native numerics Available native numerics Creating native numerics Overflow/Underflow Auto-boxing Default values Native dispatch Atomic operations Numeric infectiousness Object orientation Using objects Type objects Classes Attributes Methods Class and instance methods self Private methods Submethods Inheritance Delegation Object construction Object cloning Roles Applying roles Stubs Inheritance Pecking order Automatic role punning Parameterized roles Mixins of roles Metaobject programming and introspection Opener graphemes Operators Operator precedence Operator associativity Operator classification Substitution operators s/// in-place substitution S/// non-destructive substitution tr/// in-place transliteration TR/// non-destructive transliteration Assignment operators Metaoperators Negated relational operators Reversed operators Hyper operators Reduction metaoperators Cross metaoperators Zip metaoperator Sequential operators Nesting of metaoperators Term precedence term < > term ( ) term { } circumfix [ ] Terms Method postfix precedence postcircumfix [ ] postcircumfix { } postcircumfix <> postcircumfix < > postcircumfix « » postcircumfix ( ) methodop . methodop .& methodop .= methodop .^ methodop .? methodop .+ methodop .* methodop ». / methodop >>. methodop .postfix / .postcircumfix methodop .: methodop .:: postfix ,= Autoincrement precedence prefix ++ prefix -- postfix ++ postfix -- Exponentiation precedence infix ** Symbolic unary precedence prefix ? prefix ! prefix + prefix - prefix ~ prefix | prefix +^ prefix ~^ prefix ?^ prefix ^ Dotty infix precedence infix .= infix . Multiplicative precedence infix * infix / infix div infix % infix %% infix mod infix +& infix +< infix +> infix ~& infix ~< infix ~> infix ?& infix gcd infix lcm Additive precedence infix + infix - infix +| infix +^ infix ~| infix ~^ infix ?^ infix ?| Replication precedence infix x infix xx Concatenation infix ~ infix o, infix ∘ Junctive AND (all) precedence infix & infix (&), infix ∩ infix (.), infix ⊍ Junctive OR (any) precedence infix | infix (|), infix ∪ infix (+), infix ⊎ infix (-), infix ∖ infix ^ infix (^), infix ⊖ Named unary precedence prefix temp prefix let Nonchaining binary precedence infix does infix but infix cmp infix coll infix unicmp infix leg infix <=> infix .. infix ..^ infix ^.. infix ^..^ Chaining binary precedence infix ==, infix ⩵ infix !=, infix ≠ infix < infix <=, infix ≤ infix > infix >=, infix ≥ infix eq infix ne infix gt infix ge infix lt infix le infix before infix after infix eqv infix ===, infix ⩶ infix =:= infix ~~ infix =~= infix (elem), infix ∈ infix ∉ infix (==), infix ≡ infix ≢ infix (cont), infix ∋ infix ∌ infix (<), infix ⊂ infix ⊄ infix (<=), infix ⊆ infix ⊈ infix (>), infix ⊃ infix ⊅ infix (>=), infix ⊇ infix ⊉ Tight AND precedence infix && Tight OR precedence infix || infix ^^ infix // infix min infix max infix minmax Conditional operator precedence infix ?? !! infix ff infix ^ff infix ff^ infix ^ff^ infix fff infix ^fff infix fff^ infix ^fff^ Item assignment precedence infix = (item assignment) infix => Loose unary precedence prefix not prefix so Comma operator precedence infix , infix : List infix precedence infix Z infix X infix ... List prefix precedence infix = (list assignment) infix := infix ::= listop ... listop !!! listop ??? Reduction operators Loose AND precedence infix and infix andthen infix notandthen Loose OR precedence infix or infix orelse infix xor Sequencer precedence infix ==> infix <== Identity Creating operators Packages Names Package-qualified names Pseudo-packages Looking up names Interpolating into names Direct lookup Package lookup Class member lookup Globals Programmatic use of modules Performance First, profile your code Time with now - INIT now Profile locally Profile compiling Create or view benchmarks Share problems Solve problems Line by line Routine by routine Speed up type-checks and call resolution Choose better algorithms Change sequential/blocking code to parallel/non-blocking Use existing high performance code Make the Rakudo compiler generate faster code Still need more ideas? Not getting the results you need/want? Phasers Phasers Execution order Program execution phasers BEGIN CHECK INIT END Block phasers ENTER LEAVE KEEP UNDO PRE POST Loop phasers FIRST NEXT LAST Exception handling phasers CATCH CONTROL Object phasers COMPOSE (Not yet implemented) Asynchronous phasers LAST QUIT CLOSE DOC phasers DOC Pod6 Block structure Delimited blocks Configuration information Paragraph blocks Abbreviated blocks Declarator blocks Block types Headings Ordinary paragraphs Code blocks I/O blocks Lists Unordered lists Definition lists Multi-level lists Multi-paragraph lists Tables Pod6 comments Semantic blocks Formatting codes Bold Italic Underlined Code Links Placement links Nested Nested Comments Notes Keyboard input Replaceable Terminal output Unicode Verbatim text Nested Indexing terms Rendering Pod HTML Markdown Text Accessing Pod Pragmas v6.x MONKEY-GUTS MONKEY-SEE-NO-EVAL MONKEY-TYPING MONKEY dynamic-scope experimental fatal internals invocant isms lib newline nqp parameters precompilation soft strict trace v6 variables worries Python to Raku - nutshell Basic syntax Hello, world Statement separators Blocks Variables Scope Control flow Lambdas, functions and subroutines> List comprehensions Classes and objects Decorators Context managers input Tuples Quoting constructs The Q lang Literal strings: Q Escaping: q Interpolation: qq Interpolating variables Interpolating closures Interpolating escape codes preventing interpolation and handling missing values Word quoting: qw Word quoting: < > Word quoting with quote protection: qww Word quoting with interpolation: qqw Word quoting with interpolation and quote protection: qqww Word quoting with interpolation and quote protection: « » Shell quoting: qx Shell quoting with interpolation: qqx Heredocs: :to Unquoting Regexes Ruby to Raku - nutshell Basic syntax Statement ending semicolons Whitespace . Method calls, .public_send Variables, sigils, scope, and common types Variable scope $ Scalar @ Array % Hash & Sub * Slurpy params / argument expansion Twigils : Symbols Operators == != < > <= >= Comparisons <=> Three-way comparisons ~~ Smartmatch operator & | ^ Numeric bitwise ops & | ^ Boolean ops &. Conditional chaining operator << >> Numeric shift left, right ops, shovel operator => and : Key-value separators ? : Ternary operator + String concatenation String interpolation Compound statements Conditionals if elsif else unless case-when Loops while until for .each Flow interruption statements Regular expressions ( regex / regexp ) .match method and =~ operator .sub and .sub! Regex options Whitespace is ignored, most things must be quoted Special matchers generally fall under the <> syntax Longest token matching (LTM) displaces alternation File-related operations Reading the lines of a text file into an array Iterating over the lines of a text file Object orientation Basic classes, methods, attributes Private methods Going meta Environment variables Raku module library path Misc. Importing specific functions from a module OptionParser, parsing command-line flags RubyGems, external libraries Regexes Lexical conventions Anonymous regex definition syntax Named regex definition syntax Regex readability: whitespace and comments Match syntax Literals and metacharacters Wildcards Character classes Backslashed character classes \n and \N \t and \T \h and \H \v and \V \s and \S \d and \D \w and \W \c and \C \x and \X Predefined character classes Predefined Regexes Unicode properties Enumerated character classes and ranges Quantifiers One or more: + Zero or more: * Zero or one: ? General quantifier: ** min..max Modified quantifier: %, %% Preventing backtracking: : Greedy versus frugal quantifiers: ? Alternation: || Longest alternation: | Quoted lists are LTM matches Conjunction: && Conjunction: & Anchors Start of string and end of string Start of line and end of line Word boundary Left and right word boundary Summary of anchors Zero-width assertions Lookaround assertions Lookahead assertions Lookbehind assertions Grouping and capturing Capturing Non-capturing grouping Capture numbers Named captures Capture markers: <( )> Substitution Lexical conventions Replacing string literals Wildcards and character classes Capturing groups Common adverbs S/// non-destructive substitution Tilde for nesting structures Recursive Regexes Subrules Regex interpolation Regex Boolean condition check Adverbs Regex adverbs Ignorecase Ignoremark Ratchet Sigspace Perl compatibility adverb Matching adverbs Positional adverbs Counting Continue Exhaustive Global Pos Overlap Substitution adverbs Samecase Samemark Samespace Backtracking $/ changes each time a regular expression is matched Best practices and gotchas Regexes: best practices and gotchas Code layout Keep it small What to match Matching whitespace Sets, bags, and mixes Introduction Operators with set semantics Set operators that return Bool infix (elem), infix ∈ infix ∉ infix (cont), infix ∋ infix ∌ infix (<=), infix ⊆ infix ⊈ infix (<), infix ⊂ infix ⊄ infix (>=), infix ⊇ infix ⊉ infix (>), infix ⊃ infix ⊅ infix (==), infix ≡ infix ≢ Set operators that return a QuantHash infix (|), infix ∪ infix (&), infix ∩ infix (-), infix ∖ infix (^), infix ⊖ Set operators that return a Baggy infix (.), infix ⊍ infix (+), infix ⊎ Terms related to set operators term ∅ Statement prefixes lazy eager hyper, race quietly try do sink react Data structures Scalar structures Complex data structures Functional structures Defining and constraining data structures Infinite structures and laziness Introspection Subscripts Basics Positional subscripting Associative subscripting Applying subscripts Nonexistent elements From the end Slices Truncating slices Zen slices Multiple dimensions Modifying elements Autovivification Binding Adverbs :exists :delete :p :kv :k :v Custom types Custom type example Methods to implement for positional subscripting method elems method AT-POS method EXISTS-POS method DELETE-POS method ASSIGN-POS method BIND-POS method STORE Methods to implement for associative subscripting method AT-KEY method EXISTS-KEY method DELETE-KEY method ASSIGN-KEY method BIND-KEY method STORE Syntax Lexical conventions Free form Unspace Separating statements with semicolons Implied separator rule (for statements ending in blocks) Comments Single-line comments Multi-line / embedded comments Pod comments Identifiers Ordinary identifiers Extended identifiers Compound identifiers term term:<> Statements and expressions Terms Variables Barewords (constants, type names) Packages and qualified names Literals String literals Number literals Int literals Rat literals Num literals Complex literals Pair literals Arrow pairs Adverbial pairs (colon pairs) Boolean literals Array literals Hash literals Regex literals Signature literals Declarations Variable declaration Subroutine declaration Package, Module, Class, Role, and Grammar declaration Multi-dispatch declaration Subroutine calls Precedence drop Operators Metaoperators System interaction Getting arguments through the command line Getting arguments interactively Running programs synchronously and asynchronously Making operating system calls through the native API Pod6 tables Restrictions Best practices Good tables Bad tables Ugly tables Date and time functions Terms Literals Int Rat Num Str Regex Pair List * Identifier terms term self term now term time term rand term π term pi term τ term tau term 𝑒 term e term i term ∅ Variables Constants Testing Writing tests Thread safety Running tests Test plans Testing return values By string comparison By approximate numeric comparison By structural comparison By arbitrary comparison By object type By method name By role By regex Testing modules Testing exceptions Grouping tests Skipping tests Manual control Traits The is trait is applied to classes. is repr and native representations. is on routines is implementation-detail trait method is-implementation-detail Traps to avoid Variables and constants Constants are computed at compile time Assignment of Nil can produce a different value, usually Any Using a block to interpolate anon state vars Using set subroutines on Associative when the value is falsy Blocks Beware of empty "blocks" Objects Assigning to attributes BUILD prevents automatic attribute initialization from constructor arguments Whitespace Whitespace in regexes does not match literally Ambiguities in parsing Block vs. Hash slice ambiguity Reduction vs. Array constructor ambiguity Less than vs. Word quoting/Associative indexing Exclusive sequences vs. sequences with Ranges Captures Containers versus values in a capture Cool tricks Strings are not Lists, so beware indexing Lists become strings, so beware .index()ing Lists become strings, so beware .contains() Numeric literals are parsed before coercion Getting a random item from a List Lists numify to their number of elements in numeric context Arrays Referencing the last element of an array Typed array parameters Using «» quoting when you don't need it Strings Quotes and interpolation Beware of variables used within qqx Strings are not iterable .chars gets the number of graphemes, not Codepoints All text is normalized by default Allomorphs generally follow numeric semantics Case-insensitive comparison of strings Pairs Constants on the left-hand side of pair notation Scalar values within Pair Sets, bags and mixes Sets, bags and mixes do not have a fixed order Operators Junctions Exclusive sequence operator String ranges/Sequences Topicalizing operators Fat arrow and constants Infix operator assignment Regexes $x vs <$x>, and $(code) vs <{code}> | vs ||: which branch will win $/ changes each time a regular expression is matched vs. < foo>: named rules vs. quoted lists Non-capturing, non-global matching in list context Common precedence mistakes Adverbs and precedence Ranges and precedence Loose Boolean operators Exponentiation operator and prefix minus Method operator calls and prefix minus Subroutine and method calls Named parameters Argument count limit Phasers and implicit return LEAVE needs explicit return from a sub to run Input and output Closing open filehandles and pipes IO::Path stringification Splitting the input data into lines Proc::Async and print Using .stdout without .lines Exception handling Sunk Proc Using shortcuts The ^ twigil Using » and map interchangeably Word splitting in « » Scope Using a once block LEAVE phaser and exit LEAVE phaser may run sooner than you think Grammars Using regexes within grammar's actions Using certain names for rules/token/regexes Unfortunate generalization :exists with more than one key Using […] metaoperator with a list of lists Using [~] for concatenating a list of blobs Maps Beware of nesting Maps in sink context Smartmatching Smartmatch and WhateverCode Type system Definition of a Raku type Default types Type objects Undefinedness Coercion Type declarators class Mixins Introspection Metaclass Private attributes Methods Inheritance and multis Only method submethod BUILD Fallback method Reserved method names Methods in package scope Setting attributes with namesake variables and methods trait is nodal trait handles trait is trait is rw trait is required trait hides trait trusts Augmenting a class role Auto-punning trait does Parameterized As type constraints enum Typing Enums Metaclass Methods Coercion module package grammar subset Versioning, authorship, and API version. Unicode Filehandles and I/O Normalization UTF8-C8 Entering unicode codepoints and codepoint sequences Name aliases Named sequences Emoji sequences Unicode versus ASCII symbols Alphabetic characters Numeric characters Numeric values Whitespace characters Other acceptable single codepoints Atomic operators Multiple codepoints Entering unicode characters XCompose (Linux) Getting compose working in all programs ibus XKB (Linux) Single-user configuration System-wide configuration KDE How to enter Unicode characters using a two-key combination WinCompose (Windows) Terminals, shells, and editors: XTerm URxvt Unix shell Screen Vim vim-raku Emacs Some characters useful in Raku Smart quotes Guillemets Set/bag operators Mathematical symbols Greek characters Superscripts and subscripts Variables Sigils Item and list assignment Sigilless variables Twigils The * twigil The ? twigil The ! twigil The . twigil The ^ twigil The : twigil A note on ^ and : The = twigil The ~ twigil Variable declarators and scope The my declarator The our declarator Declaring a list of variables with lexical (my) or package (our) scope The has declarator The anon declarator The state declarator The $ variable The @ variable The % variable The augment declarator The temp prefix The let prefix The constant prefix Type constraints and initialization Default defined variables pragma Special variables Pre-defined lexical variables The $_ variable The $/ variable Positional attributes Named attributes Thread-safety issues The $! variable Compile-time variables %?RESOURCES Introspection compile-time variables Rakudo-specific compile-time variables &?ROUTINE &?BLOCK $?DISTRIBUTION Dynamic variables Argument related variables $*ARGFILES @*ARGS &*ARGS-TO-CAPTURE &*GENERATE-USAGE Special filehandles: STDIN, STDOUT and STDERR Runtime environment %*ENV $*REPO $*INIT-INSTANT $*TZ $*CWD $*KERNEL $*DISTRO $*VM $*RAKU $*PERL $*PID $*PROGRAM-NAME $*PROGRAM &*EXIT $*EXECUTABLE $*EXECUTABLE-NAME $*USAGE $*USER $*GROUP $*HOMEDRIVE $*HOMEPATH $*HOME $*SPEC $*TMPDIR $*THREAD $*SCHEDULER $*SAMPLER Runtime variables $*DEFAULT-READ-ELEMS $*COLLATION $*RAT-OVERFLOW $*TOLERANCE Naming conventions class int Debugging Core debugging features The trace pragma Dumper function (dd) Using backtraces Environment variables Ecosystem debugging modules Debugger::UI::CommandLine Grammar::Debugger (and Grammar::Tracer in the same distribution) Trait::Traced Reading the docs INTRODUCTION SYNOPSIS DESCRIPTION LIMITATIONS Environment variables used by the raku command line Module loading Error message verbosity and strictness Affecting precompilation Line editor Other WINDOWS PECULIARITIES Non-console applications AUTHORS Running Raku NAME SYNOPSIS DESCRIPTION AUTHORS class AST class Allomorph Methods method ACCEPTS method Bool method chomp method chop method comb method fc method flip method lc method pred method raku method samecase method samemark method split method Str method subst method subst-mutate method substr method substr-rw method succ method tc method tclc method trim method trim-leading method trim-trailing method uc method WHICH Operators infix cmp infix eqv class Any Methods method ACCEPTS method any method all method one method none method list method push routine reverse method sort routine map method deepmap method duckmap method nodemap method flat method eager method elems method end method pairup sub item method Array method List method serial method Hash method hash method Slip method Map method Seq method Bag method BagHash method Set method SetHash method Mix method MixHash method Supply routine min routine max routine minmax method minpairs method maxpairs method keys method flatmap method roll method iterator method pick method skip method are method prepend method unshift routine first method unique method repeated method squish method permutations method join routine categorize routine classify routine reduce routine produce method pairs method antipairs method invert routine kv method toggle method head method tail method tree method nl-out method combinations method grep method append method values method collate method cache method batch method rotor method sum class Array Methods method gist method pop method push method append method elems method clone method flat method shift routine unshift routine prepend routine splice method shape method default method of method dynamic method List method Slip role Associative Methods method of method keyof Methods that classes mixing Associative should provide method AT-KEY method EXISTS-KEY method STORE See also class Attribute Traits Trait is default Trait is required trait is DEPRECATED trait is rw trait is built Methods method name method package method has_accessor method rw method readonly method required method type method get_value method set_value method gist Optional introspection DEPRECATED class Backtrace Methods method new method gist method Str method next-interesting-index method outer-caller-idx method nice method full method list method summary method concise method map method flat class Backtrace::Frame Methods method file method line method code method subname method is-hidden method is-routine method is-setting class Bag Creating Bag objects Operators Subroutines sub bag Note on reverse and ordering See also class BagHash Creating BagHash objects Updating BagHash Objects Operators Note on reverse and ordering. method add method remove See Also role Baggy Methods method new-from-pairs method grab method grabpairs method pick method pickpairs method roll method pairs method antipairs method invert method classify-list method categorize-list method keys method values method kv method kxxv method elems method total method default method hash method Bool method Set method SetHash method ACCEPTS See Also role Blob Methods method new method Bool method Capture method elems method bytes method chars method Str method Stringy method decode method list method gist method subbuf method allocate routine unpack sub pack method reverse Methods on blob8 only (6.d, 2018.12 and later) method read-uint8 method read-int8 method read-uint16 method read-int16 method read-uint32 method read-int32 method read-uint64 method read-int64 method read-uint128 method read-int128 method read-num32 method read-num64 Methods on blob8 only (6.d, 2019.03 and later) method read-ubits method read-bits class Block enum Bool Methods method ACCEPTS routine succ routine pred routine enums routine pick routine roll routine Int routine Numeric Operators prefix ? prefix so role Buf Methods method subbuf-rw routine subbuf-rw method reallocate method list method push method pop method append method prepend method shift method unshift method splice Methods on buf8 only (6.d, 2018.12 and later) method write-uint8 method write-int8 method write-uint16 method write-int16 method write-uint32 method write-int32 method write-uint64 method write-int64 method write-uint128 method write-int128 method write-num32 method write-num64 Methods on buf8 only (6.d, 2019.03 and later) method write-ubits method write-bits Methods on buf8 only (6.d, 2019.10 and later) method write-uint8 method write-int8 method write-uint16 method write-int16 method write-uint32 method write-int32 method write-uint64 method write-int64 method write-uint128 method write-int128 method write-num32 method write-num64 method write-ubits method write-bits role CX::Done Methods method message role CX::Emit Methods method message role CX::Last Methods method message role CX::Next Methods method message role CX::Proceed Methods method message role CX::Redo Methods method message role CX::Return Methods method message role CX::Succeed Methods method message role CX::Take Methods method message role CX::Warn Methods method new class CallFrame Methods method code method file method line method annotations method my Routines sub callframe role Callable Methods method CALL-ME method Capture class Cancellation Methods method cancel class Capture Methods method list method hash method elems method keys method values method kv method pairs method antipairs method Bool method Capture method Numeric class Channel Methods method send method receive method poll method close method list method closed method fail method Capture method Supply sub await class Code Methods method ACCEPTS method arity method assuming method count method of method signature method cando method Str method file method line method is-implementation-detail class Collation Methods method set method primary method secondary method tertiary method quaternary class CompUnit Methods method auth method distribution method from method precompiled method repo method repo-id method short-name method version role CompUnit::PrecompilationRepository Methods method new-unit method load-unit method load-repo-id method store-file method store-unit method store-repo-id method delete method delete-by-compiler role CompUnit::Repository Methods method resolve method need method load method loaded class CompUnit::Repository::FileSystem Methods method candidates method files method resolve method need method load method loaded method short-id class CompUnit::Repository::Installation Methods method install method uninstall method candidates method files method resolve method need method load method loaded method short-id class Compiler Methods method id method release method codename method backend method build-date method verbose-config class Complex Operators postfix i Methods method new method re method im method reals method isNaN method polar method floor method ceiling method round method truncate routine abs method conj method sqrt method gist method raku method Real sub infix:<**> class ComplexStr Methods method new method Capture method Complex method Numeric method Real Operators infix === class Cool Methods routine abs method conj method EVAL routine sqrt method sign method rand routine sin routine asin routine cos routine acos routine tan routine atan routine atan2 routine sec routine asec routine cosec routine acosec routine cotan routine acotan routine sinh routine asinh routine cosh routine acosh routine tanh routine atanh routine sech routine asech routine cosech routine acosech routine cotanh routine acotanh routine cis routine log routine log10 routine log2 routine exp method unpolar routine round routine floor method fmt routine ceiling routine truncate routine ord method path routine chr routine chars routine codes routine flip routine trim routine trim-leading routine trim-trailing routine lc routine uc routine fc routine tc routine tclc routine wordcase routine samecase routine uniprop sub uniprops routine uniname routine uninames routine unimatch routine chop routine chomp routine substr routine substr-rw routine ords routine chrs routine split routine lines method words routine comb method contains routine index routine rindex method match routine roots method subst method trans method IO method sprintf method printf method Complex method FatRat method Int method Num method Rat method Real method UInt class CurrentThreadScheduler class Date Methods method new method new-from-daycount method last-date-in-month method first-date-in-month method clone method today method truncated-to method succ method pred method Str method gist method Date method DateTime Functions sub sleep sub sleep-timer sub sleep-until sub infix:<-> sub infix:<+> class DateTime Methods method new method now method clone method hh-mm-ss method hour method minute method second method whole-second method timezone method offset method offset-in-minutes method offset-in-hours method Str method Instant method day-fraction method julian-date method modified-julian-date method posix method truncated-to method Date method DateTime method utc method in-timezone method local sub infix:<-> sub infix:<+> sub infix:«<=>» sub infix: sub infix:«<» sub infix:«>» sub infix:«<=» sub infix:«>=» sub infix:«==» sub infix:«!=» role Dateish Methods method year method month method day method formatter method is-leap-year method day-of-month method day-of-week method day-of-year method days-in-month method week method week-number method week-year method weekday-of-month method yyyy-mm-dd method mm-dd-yyyy method dd-mm-yyyy method daycount method IO method earlier method later role Distribution Required Methods method meta method content class Distribution::Hash Methods method new method meta method content class Distribution::Locally Methods method prefix method content class Distribution::Path Methods method new method meta method content class Distribution::Resource Methods method IO class Distro Methods method is-win method path-sep method release class Duration role Encoding Methods method name method alternative-names method decoder method encoder class Encoding::Registry Methods method name method find enum Endian Methods routine Numeric role Enumeration Methods method key method value method enums method kv method pair method CALL-ME method pick method roll method pred method succ method Numeric method Int method Real method === class Exception Methods method message method backtrace method throw method resume method rethrow routine fail method gist routine die sub warn class Failure Methods method new method handled method exception method self method Bool method Capture method defined method list sub fail class FatRat Methods method raku class ForeignCode Methods method arity method count method signature method name method gist method Str class Grammar Methods method parse method subparse method parsefile class Hash Methods method classify-list Simple classification Multi-level classification :&as value modifier method categorize-list Simple categorization Multi-level categorization :&as value modifier method push method append method default method keyof method of routine dynamic Subscript Adverbs :exists :delete :p :v and :k class HyperSeq Methods method iterator method grep method map method invert method hyper method race method serial method is-lazy method sink class HyperWhatever Standalone term Currying role IO class IO::ArgFiles Variables $*ARGFILES class IO::CatHandle Methods method new method chomp method nl-in method close method comb method DESTROY method encoding method eof method get method getc method handles method IO method lines method lock method native-descriptor method next-handle method on-switch method open method opened method path method read method readchars method seek method tell method slurp method split method Str method Supply method t method unlock method words NYI Methods method flush method nl-out method out-buffer method print method printf method print-nl method put method say method write method WRITE method READ method EOF class IO::Handle Methods method open method comb method chomp routine get routine getc Buffering terminals Waiting for potential combiners submethod DESTROY method gist method eof method encoding utf16, utf16le and utf16be Examples routine lines method lock method unlock routine words method split method spurt method print method print-nl method printf method out-buffer method put method say method read method readchars method write method seek method tell method slurp-rest method slurp method Supply method path method IO method Str routine close method flush method native-descriptor method nl-in method nl-out method opened method t Creating Custom Handles method WRITE method READ method EOF Related roles and classes class IO::Notification Methods method watch-path class IO::Notification::Change Methods method path method event method IO method gist class IO::Path Methods method new attribute CWD attribute SPEC attribute path method ACCEPTS method basename method add method child method cleanup method comb method split method extension method dirname method volume method parts method raku method gist method Str method succ method open method pred method watch method is-absolute method is-relative method absolute method relative method parent method resolve routine dir File test operators method e method d method f method s method l method r method w method rw method x method rwx method z method sibling method words method lines routine slurp method spurt method chdir method mkdir routine rmdir method chmod routine rename routine copy routine move method Numeric method Int routine symlink routine link routine unlink method IO method SPEC File timestamp retrieval method modified method accessed method changed File permissions retrieval method mode class IO::Path::Cygwin Methods method new method raku class IO::Path::Parts Methods method new attribute volume attribute dirname attribute basename Previous implementations class IO::Path::QNX Methods method new method raku class IO::Path::Unix Methods method new method raku class IO::Path::Win32 Methods method new method raku class IO::Pipe Methods method close method IO method path method proc role IO::Socket Methods method recv method read routine get method print method write method put method close method native-descriptor class IO::Socket::Async Methods method connect method listen method udp method bind-udp method print method print-to method write method write-to method Supply method close method socket-host method peer-host method socket-port method peer-port method native-descriptor class IO::Socket::Async::ListenSocket Methods method socket-host method socket-port method native-descriptor class IO::Socket::INET Methods method new Methods method get method lines method accept class IO::Spec About sub-classes IO::Spec::* Methods class IO::Spec::Cygwin Methods method abs2rel method canonpath method catdir method catpath method is-absolute method join method rel2abs method split method splitpath method tmpdir class IO::Spec::QNX Methods method canonpath class IO::Spec::Unix Methods method abs2rel method basename method canonpath method catdir method catfile method catpath method curdir method curupdir method devnull method dir-sep method extension method is-absolute method join method path method rel2abs method rootdir method split method splitdir method splitpath method tmpdir method updir class IO::Spec::Win32 Methods method basename method canonpath method catdir method catfile method catpath method devnull method dir-sep method is-absolute method join method path method rel2abs method rootdir method split method splitdir method splitpath method tmpdir class IO::Special Methods method new method what method WHICH method Str method IO method e method d method f method s method l method r method w method x method modified method accessed method changed method mode class Instant Future Leap Seconds Methods method from-posix method to-posix method Date method DateTime class Int Methods method new method Capture routine chr routine expmod method polymod routine is-prime routine lsb routine msb routine unival method Range method Bridge Operators infix div class IntStr Methods method new method Int method Numeric method Real Operators infix === role Iterable Methods method iterator method flat method lazy method hyper Options degree and batch method race role Iterator IterationEnd Methods method pull-one method push-exactly method push-at-least method push-all method push-until-lazy method is-deterministic method is-lazy method sink-all method skip-one method skip-at-least method skip-at-least-pull-one Predictive iterators class Junction Failures and exceptions Smartmatching Methods method new method defined method Bool method Str method iterator method gist method raku infix ~ See Also class Kernel Methods method arch method archname method bits method cpu-cores method cpu-usage method free-memory method total-memory method endian method hardware method hostname method release method signal method signals class Label Methods method name method file method line method Str method next method redo method last class List Immutability Items, flattening and sigils Methods method ACCEPTS routine list routine elems routine end routine keys routine values routine kv routine pairs routine antipairs routine invert routine join routine map method flatmap method gist routine grep routine first method head method tail routine categorize routine classify method Bool method Str method Int method Numeric method Capture routine pick routine roll routine eager routine reverse routine rotate routine sort routine reduce routine produce routine combinations routine permutations method rotor method batch routine cross routine zip routine roundrobin routine sum method fmt method from method to method sink method Set Operators infix cmp class Lock Methods method protect method lock method unlock method condition class Lock::Async Methods method lock method unlock method protect method protect-or-queue-on-recursion method with-lock-hidden-from-recursion-check class Lock::ConditionVariable Methods method wait method signal class Macro class Map Methods method new method elems method ACCEPTS method gist method keys method values method pairs method antipairs method invert method kv method list method sort method Int method Numeric method Bool method Capture class Match Methods method pos method target method chars method clone method orig method from method to method made routine make method actions method ast method Bool method Str method Int method caps method chunks method list method hash method prematch method postmatch method replace-with infix eqv role Metamodel::AttributeContainer Methods method add_attribute method attributes method set_rw method rw role Metamodel::C3MRO Methods method compute_mro method mro method mro_unhidden class Metamodel::ClassHOW Methods method add_fallback method can method lookup method compose method new_type role Metamodel::ConcreteRoleHOW role Metamodel::CurriedRoleHOW class Metamodel::DefiniteHOW Methods method new_type method name method shortname method base_type method definite method nominalize method find_method method type_check method accepts_type role Metamodel::Documenting Methods method set_why method WHY class Metamodel::EnumHOW Methods method new_type method add_parent method set_export_callback method export_callback method compose method is_composed method compose_values method set_composalizer method composalizer method add_enum_value method enum_values method elems method enum_from_value method enum_value_list role Metamodel::Finalization Methods method setup_finalization method destroyers role Metamodel::MROBasedMethodDispatch Methods method find_method method find_method_qualified method can method publish_method_cache role Metamodel::MethodContainer Methods method add_method method methods method method_table method lookup role Metamodel::Mixins Methods method set_is_mixin method is_mixin method set_mixin_attribute method mixin_attribute method setup_mixin_cache method flush_cache method generate_mixin method mixin role Metamodel::MultipleInheritance Methods method add_parent method parents method hides method hidden method set_hidden role Metamodel::Naming Methods method name method set_name class Metamodel::PackageHOW Methods method archetypes method new method new_type compose is_composed role Metamodel::ParametricRoleGroupHOW role Metamodel::ParametricRoleHOW class Metamodel::Primitives Methods method create_type method set_package method install_method_cache method configure_type_checking method configure_destroy method compose_type method rebless method is_type method set_parameterizer method parameterize_type method type_parameterized method type_parameters method type_parameter_at role Metamodel::PrivateMethodContainer Methods method add_private_method method private_method_table method private_methods method private_method_names method find_private_method role Metamodel::RoleContainer Methods method add_role method roles_to_compose role Metamodel::RolePunning role Metamodel::Stashing Methods method add_stash role Metamodel::Trusting Methods method add_trustee method trusts method is_trusted role Metamodel::Versioning Methods method ver method auth method api method set_ver method set_auth method set_api class Method class Mix Creating Mix objects Operators sub mix Methods method Bag method BagHash method reverse method total Note on order See Also class MixHash Creating MixHash objects Operators Note on reverse and ordering. Methods method Bag method BagHash See Also role Mixy Methods method roll method pick method grab method kxxv See Also class Mu Methods method iterator method defined routine defined routine isa routine does routine Bool method Capture method Str routine gist method perl method raku method item method self method clone method new method bless method CREATE method print method put method say method ACCEPTS method WHICH method WHERE method WHY trait is export method return method return-rw method emit method take routine take routine take-rw method so method not class NFC class NFD class NFKC class NFKD class Nil Methods method append method gist method Str method new method prepend method push method unshift method ords method chrs method FALLBACK method Numeric class Num Inf NaN method new method rand sub srand method Capture method Int method Rat method FatRat method Num method Str method Bridge class NumStr Methods method new method Num method Numeric method Real Operators infix === role Numeric Methods method Numeric method narrow method ACCEPTS routine log routine log10 routine log2 routine exp method roots routine abs routine sqrt method conj method Bool method succ method pred class ObjAt Methods infix eqv enum Order Operators infix cmp infix <=> class Pair Methods method new method ACCEPTS method antipair method key method value infix cmp method fmt method kv method pairs method antipairs method invert method keys method values method freeze method Str method Pair class Parameter Methods method name method usage-name method sigil method type method coerce_type method constraints method named method named_names method positional method slurpy method twigil method optional method raw method capture method rw method copy method readonly method invocant method default method type_captures method sub_signature method prefix method suffix Runtime creation of Parameter objects (6.d, 2019.03 and later) class Perl class Pod::Block Methods method contents method config class Pod::Block::Code class Pod::Block::Comment class Pod::Block::Declarator Methods method leading method trailing method WHEREFORE class Pod::Block::Named Methods method name class Pod::Block::Para class Pod::Block::Table Methods method caption method headers class Pod::Defn Methods method term class Pod::FormattingCode Methods method type method meta class Pod::Heading Methods method level class Pod::Item Methods method level role Positional Methods method of Methods that should be provided by classes that mix in this role method elems method AT-POS method EXISTS-POS method STORE See also role PositionalBindFailover Methods method cache method list method iterator role PredictiveIterator Methods method count-only method bool-only class Proc Potential Deadlocks Methods routine new method sink method spawn method shell method command method Bool method pid method exitcode method signal class Proc::Async Methods method new method stdout method stderr method bind-stdin method bind-stdout method bind-stderr method w method start method started method ready method pid method path method args method command method write method print method put method say method Supply method close-stdin method kill class Promise Methods method start method in method at method kept method broken method allof method anyof method then method keep method break method result method cause method Bool method status method scheduler method vow method Supply sub await class Proxy Methods method new class PseudoStash role QuantHash Methods method hash method Hash method of method keyof method Capture method list method Setty method Baggy method Mixy class RaceSeq Methods method iterator method grep method map method invert method race method hyper method serial method is-lazy method sink class Raku Methods method compiler method DISTROnames method KERNELnames method VMnames See Also class Range Ranges in subscripts Shifting and scaling intervals Matching against Ranges Methods method ACCEPTS method min method excludes-min method max method excludes-max method bounds method infinite method is-int method int-bounds method minmax method elems method list method flat method pick method roll method sum method reverse method Capture method rand method EXISTS-POS method AT-POS method raku method fmt method WHICH sub infix:<+> sub infix:<-> sub infix:<*> sub infix: sub infix: class Rat Methods method raku class RatStr Methods method new method Capture method Numeric method Rat method Real Operators infix === role Rational Methods method new method Bool method Bridge method Int method Num method ceiling method floor method isNaN method numerator method denominator method nude method norm method base-repeating method Range role Real Methods method Bridge method Complex method Int method Rat method Real method Str method Num routine rand method sign method round method floor method ceiling method truncate method polymod method base class Regex Methods method ACCEPTS method Bool class Routine Methods method name method package method multi method candidates method cando method wrap method unwrap method is-wrapped method yada trait is cached trait is pure trait is rw trait is export trait is DEPRECATED trait is hidden-from-backtrace trait is default trait is raw trait is test-assertion class Routine::WrapHandle Methods method restore class Scalar Atomic operations on Scalar Introspection method of method default method name method dynamic Routines sub atomic-assign sub atomic-fetch sub cas Operators infix ⚛= prefix ⚛ role Scheduler Methods method uncaught_handler method cue method loads class Semaphore Methods method new method acquire method try_acquire method release class Seq Methods method new method iterator method is-lazy method Seq method Capture method elems method from-loop method sink method skip role Sequence Methods method Str method Stringy method Numeric method AT-POS method EXISTS-POS method eager method fmt method gist class Set Creating Set objects Operators Subroutines sub set See Also class SetHash Creating SetHash objects Operators Methods method set method unset See Also role Setty Methods method new-from-pairs method grab method grabpairs method pick method pickpairs method roll method antipairs method keys method values method kv method elems method total method minpairs method maxpairs method default method ACCEPTS method Bag method BagHash method Bool method Mix method MixHash See Also class Signature Signature literals Parameter separators Type constraints Constraining optional arguments Constraining slurpy arguments Constraining named arguments Constraining argument definiteness Constraining signatures of Callables Constraining return types Return type arrow: --> returns of prefix(C-like) form Coercion type Slurpy parameters Types of slurpy array parameters Flattened slurpy Unflattened slurpy Single argument rule slurpy Type captures Positional vs. named arguments Argument aliases Optional and mandatory arguments Dynamic variables Destructuring arguments Sub-signatures Long names Capture parameters Parameter traits and modifiers Methods method params method arity method count method returns method ACCEPTS method Capture Runtime creation of Signature objects (6.d, 2019.03 and later) class Slip Methods method List sub slip Constants constant Empty class Stash class Str Methods routine chop routine chomp method contains routine lc routine uc routine fc routine tc routine tclc routine wordcase method unival method univals routine chars method encode method index routine rindex method indices method match method Numeric method Num method Int method Rat method Bool routine parse-base routine parse-names routine uniparse method samecase routine split routine comb routine lines routine words routine flip method starts-with method ends-with method subst Literal replacement substitution Callable Adverbs More Examples method subst-mutate routine substr method substr-eq method substr-rw routine samemark method succ method pred routine ord method ords method trans method indent method trim method trim-trailing method trim-leading method NFC method NFD method NFKC method NFKD method ACCEPTS method Capture routine val method Version method Date method DateTime class StrDistance Methods method before method after method Bool method Numeric method Int method Str role Stringy class Sub Operators Traits class Submethod Methods method gist class Supplier Methods method new method Supply method emit method done method quit class Supplier::Preserving Methods method new class Supply Methods that return Taps method tap method act Utility methods method Capture method Channel method Promise method live method schedule-on Methods that wait until the supply is done method wait method list method Seq method grab method reverse method sort method collate method reduce Methods that return another Supply method from-list method share method flat method do method on-close method interval method grep method map method batch method elems method head method tail method first method split method rotate method rotor method delayed method throttle control messages status message Examples method stable method produce method lines method words method unique method repeated method squish method max method min method minmax method skip method start method migrate Methods that combine supplies method merge method zip method zip-latest I/O features exposed as supplies sub signal method IO::Notification.watch-path role Systemic Methods method auth method config method desc method name method signature method version method gist method Str class Tap Methods method close class Telemetry routine T routine snap routine snapper routine periods routine report module snapper class Telemetry::Instrument::Thread class Telemetry::Instrument::ThreadPool class Telemetry::Instrument::Usage Useful readings Head class Telemetry::Period class Telemetry::Sampler method new method set-instruments module Test Methods sub plan sub done-testing sub ok sub nok sub is sub isnt sub is_approx sub is-approx Absolute tolerance Relative tolerance Both absolute and relative tolerance specified sub is-approx-calculate sub is-deeply sub cmp-ok sub isa-ok sub can-ok sub does-ok sub like sub unlike sub use-ok sub dies-ok sub lives-ok sub eval-dies-ok sub eval-lives-ok sub throws-like sub fails-like sub subtest sub todo sub skip sub skip-rest sub bail-out sub pass sub flunk sub diag class Thread Methods method new method start method run method id method finish method join method yield method app_lifetime method name method Numeric method Str method is-initial-thread Routines sub full-barrier class ThreadPoolScheduler Methods new Subset UInt class Uni Methods method new method list method NFC method NFD method NFKC method NFKD method codes method elems class VM Methods method osname method precomp-ext method precomp-target method prefix class ValueObjAt class Variable Traits trait is default trait is dynamic trait of Methods method name class Version Methods method new method parts method plus method Str method gist method Capture class Whatever Methods method ACCEPTS method Capture class WhateverCode class X::AdHoc Methods method payload method Numeric method from-slurpy class X::Anon::Augment Methods method package-kind class X::Anon::Multi Methods method multiness method routine-type class X::Assignment::RO Methods method typename class X::Attribute::NoPackage Methods method name class X::Attribute::Package Methods method name method package-kind class X::Attribute::Required Methods method name method why class X::Attribute::Undeclared Methods method package-kind method package-name class X::Augment::NoSuchType Methods method package-kind method package class X::Bind class X::Bind::NativeType Methods method name class X::Bind::Slice Methods method type class X::Caller::NotDynamic Methods method symbol class X::Cannot::Empty Methods method action method what class X::Cannot::Lazy Methods method action method what class X::Channel::ReceiveOnClosed Methods method channel class X::Channel::SendOnClosed Methods method channel role X::Comp Methods method filename method line method column class X::Composition::NotComposable Methods method target-name method composer class X::Constructor::Positional role X::Control class X::ControlFlow Methods method illegal method enclosing class X::ControlFlow::Return class X::DateTime::TimezoneClash Methods method message class X::Declaration::Scope Methods method scope method declaration class X::Declaration::Scope::Multi class X::Does::TypeObject Methods method type class X::Dynamic::NotFound Methods method name class X::Eval::NoSuchLang Methods method lang class X::Export::NameClash Methods method symbol role X::IO class X::IO::Chdir Methods method path class X::IO::Chmod class X::IO::Copy Methods method from method to class X::IO::Cwd class X::IO::Dir Methods method path class X::IO::DoesNotExist Methods method path method trying class X::IO::Link Methods method target method name class X::IO::Mkdir Methods method path method mode class X::IO::Move Methods method from method to class X::IO::Rename Methods method from method to class X::IO::Rmdir Methods method path class X::IO::Symlink Methods method name method target class X::IO::Unlink Methods method path class X::Inheritance::NotComposed Methods method child-name method parent-name class X::Inheritance::Unsupported Methods method child-typename method parent class X::Method::InvalidQualifier Methods method method method invocant method qualifier-type class X::Method::NotFound Methods method method method typename method private method addendum class X::Method::Private::Permission Methods method method method source-package method calling-package class X::Method::Private::Unqualified Methods method method class X::Mixin::NotComposable Methods method target method rolish class X::NYI Methods method new method feature method did-you-mean method workaround method message class X::NoDispatcher Methods method redispatcher class X::Numeric::Real Methods method source method target method reason role X::OS Methods method os-error class X::Obsolete Methods method old method replacement method when class X::OutOfRange Methods method what method got method range method comment class X::Package::Stubbed Methods method packages class X::Parameter::Default Methods method how method parameter class X::Parameter::MultipleTypeConstraints Methods method parameter class X::Parameter::Placeholder Methods method parameter method right class X::Parameter::Twigil Methods method parameter method twigil class X::Parameter::WrongOrder Methods method misplaced method parameter method after class X::Phaser::Multiple Methods method block class X::Phaser::PrePost Methods method phaser method condition class X::Placeholder::Block Methods method placeholder class X::Placeholder::Mainline role X::Pod role X::Proc::Async Methods method proc class X::Proc::Async::AlreadyStarted class X::Proc::Async::BindOrUse class X::Proc::Async::CharsOrBytes Methods method handle class X::Proc::Async::MustBeStarted Methods method method class X::Proc::Async::OpenForWriting Methods method method class X::Proc::Async::TapBeforeSpawn Methods method handle class X::Proc::Unsuccessful Methods method proc class X::Promise::CauseOnlyValidOnBroken Methods method promise method status class X::Promise::Vowed Methods method promise class X::Redeclaration Methods method symbol method what method postfix class X::Role::Initialization Methods method role class X::Scheduler::CueInNaNSeconds class X::Seq::Consumed class X::Sequence::Deduction class X::Signature::NameClash Methods method name class X::Signature::Placeholder Methods method placeholder class X::Str::Numeric Methods method source method pos method reason class X::StubCode Methods method message role X::Syntax class X::Syntax::Augment::WithoutMonkeyTyping class X::Syntax::Comment::Embedded class X::Syntax::Confused class X::Syntax::InfixInTermPosition Methods method infix class X::Syntax::Malformed Methods method what class X::Syntax::Missing Methods method what class X::Syntax::NegatedPair Methods method key class X::Syntax::NoSelf Methods method variable class X::Syntax::Number::RadixOutOfRange Methods method radix class X::Syntax::P5 class X::Syntax::Perl5Var class X::Syntax::Regex::Adverb Methods method adverb method construct class X::Syntax::Regex::SolitaryQuantifier class X::Syntax::Reserved Methods method reserved method instead class X::Syntax::Self::WithoutObject class X::Syntax::Signature::InvocantMarker class X::Syntax::Term::MissingInitializer class X::Syntax::UnlessElse class X::Syntax::Variable::Match class X::Syntax::Variable::Numeric Methods method what class X::Syntax::Variable::Twigil Methods method twigil method scope role X::Temporal class X::Temporal::InvalidFormat Methods method invalid-str method target method format class X::TypeCheck Methods method operation method got method expected class X::TypeCheck::Assignment class X::TypeCheck::Binding class X::TypeCheck::Return class X::TypeCheck::Splice Methods method action class X::Undeclared Methods method symbol method what class atomicint Routines sub atomic-assign sub atomic-fetch sub atomic-fetch-inc sub atomic-fetch-dec sub atomic-fetch-add sub atomic-fetch-sub sub atomic-inc-fetch sub atomic-dec-fetch sub cas Operators infix ⚛= prefix ⚛ prefix ++⚛ postfix ⚛++ prefix --⚛ postfix ⚛-- infix ⚛+= infix ⚛-= infix ⚛−= Independent routines routine EVAL sub EVALFILE sub repl Note: repl was introduced in release 2021.06 of the Rakudo compiler. sub get sub getc sub mkdir sub chdir sub &*chdir sub chmod sub indir sub print sub put sub say routine note sub prompt sub open sub slurp sub spurt Options Examples sub run sub shell routine unpolar routine printf routine sprintf Directives Modifiers NYI Format parameter index using the '$' symbol Without index: NYI With index: Flags Vector flag 'v' Width (minimum) Precision, or maximum width Size Order of arguments sub flat routine unique routine repeated routine squish sub emit sub undefine Array manipulation sub pop sub shift sub push sub append Control routines sub exit sub done sub lastcall class utf8
Website Index
Term explained (not clickable)
Source file (clickable)
In section (clickable)
Adverbs
:x (quoting adverb) :exec (quoting adverb) :w (quoting adverb) :words (quoting adverb) :ww (quoting adverb) :quotewords (quoting adverb) :q (quoting adverb) :single (quoting adverb) :qq (quoting adverb) :double (quoting adverb) :s (quoting adverb) :scalar (quoting adverb) :a (quoting adverb) :array (quoting adverb) :h (quoting adverb) :hash (quoting adverb) :f (quoting adverb) :function (quoting adverb) :c (quoting adverb) :closure (quoting adverb) :b (quoting adverb) :backslash (quoting adverb) :to (quoting adverb) :heredoc (quoting adverb) :v (quoting adverb) :val (quoting adverb) :ignorecase :i :ignoremark :m :ratchet :r :sigspace :s :1st :2nd :3rd :nth :x :continue :c :exhaustive :ex :global :g :pos :p :overlap :ov :samecase :ii :samemark :mm :samespace :ss :exists (subscript adverb) :delete (subscript adverb) :p (subscript adverb) :kv (subscript adverb) :k (subscript adverb) :v (subscript adverb)
Asynchronous phasers
LAST QUIT CLOSE DOC
Circumfix operators
Array constructor
Control flow
whenever react statements blocks Phasers do start if else elsif unless with orwith without when for gather take supply emit given default when proceed succeed given statement loop while until repeat return return-rw fail once next last redo
Infix operators
Multiplication operator Division operator Integer division operator Modulo operator Divisibility operator Integer modulo operator Numeric bitwise AND operator integer left bit shift operator integer right bit shift operator Boolean logical AND operator greatest common divisor operator least common multiple operator Addition operator Subtraction operator Integer bitwise OR operator Integer bitwise XOR operator Boolean logical XOR operator Boolean logical OR operator String repetition operator List repetition operator string concatenation operator o function composition operator All junction operator Intersection operator Baggy multiplication operator Any junction operator Union operator Baggy addition operator Set difference operator One junction operator Symmetric set difference operator Generic three-way comparator String tree-way comparator Numeric three-way comparator spaceship operator Range operator Right-open range operator Left-open range operator Open range operator Numeric equality operator Numeric inequality operator Numeric less than operator Numeric less than or equal to operator Numeric greater than operator Numeric greater than or equal to operator String equality operator String inequality operator String greater than operator String greater than or equal to operator String less than operator String less than or equal to operator equivalence operator Value identity operator Container identity operator smartmatch operator Membership operator (elem) Non-membership operator (elem) Set equality operator Set inequality operator Membership operator (cont) Non-membership operator (cont) Subset of operator Not a subset of operator Subset of or equal to operator Not a subset of nor equal to operator Superset of operator Not a superset of operator Superset of or equal to operator Not a superset of nor equal to operator Short-circuit exclusive-or defined-or operator // flipflop pair constructor Zip operator cross product operator X ... ...^ ^... ^...^ …^ ^… ^…^ sequence operator List assignment operator binding operator Read-only binding operator notandthen orelse feed leftward feed exponentiation operator
Language
find_method private_methods find_private_methods \ (container binding) sink context sinking number context string context Boolean context list context CATCH try blocks pack macros quasi (macros) unquoting (macros) {{{}}} (macros) :cached pointy blocks Argument closures use soft (pragma) wrapped routines Adverb Adverbial Pair Allomorph ASCII operator Texas operator Autothreading Creating grammars proto regex hash slice non-string keys object hash IPC Single Argument Rule laziness in Iterable objects typed array Shaped arrays import compunit MOP Introspection is itemized? nativecall deref native array Type objects Attribute indirect invocant syntax Private methods Submethods MRO delegation (trait handles) new (method) Parameterized Roles Mixins prefix operator infix operator postfix operator circumfix operator postcircumfix operator method operators metamethod call hyper method call operator postfix operator call class-qualified method call interpolating into names Unquoting Regular Expressions escaping characters Zen slices identifiers Date ranges Forward declarations FALLBACK (method) WHAT (reserved method) WHO (reserved method) HOW (reserved method) VAR (reserved method) FALLBACK (trait handles) role (typesystem) Type Capture (role) dynamic subset Dynamically scoped variables declaring a list of variables destructuring assignment anon state variables nameless variables constants (syntax) topic variable match variable error variable dumper collation levels Boolean Nil assignment colon pair (Pair) colon list (Pair) named regex type constraint Constraint anonymous arguments where clause Coercion type slurpy argument Type capture positional argument named argument argument aliases optional argument mandatory named argument destructuring arguments sub-signature Long names
Listop operators
stub operator Fatal stub operator
Metaoperators
! (negation metaoperator) R reverse metaoperator [] (reduction metaoperators) [+] (reduction metaoperators) [\] (triangular reduction metaoperators) X (cross metaoperator) Z (zip metaoperator) S sequential metaoperator
Methods
overriding default accessors programmatic use signatures TWEAK in-range
Modules
CompUnit (Rakudo classes)
Operators
s/// in-place substitution S/// non-destructive substitution tr/// in-place transliteration TR/// non-destructive transliteration << >> « » »=« «=» call operator Safe call operator prefix increment operator prefix decrement operator postfix increment operator postfix decrement operator exponentiation operator Boolean context operator Negated Boolean context operator Numeric context operator ternary conditional item = Admonitory stub operator and andthen
Other languages
filetests - perlfunc abs - perlfunc accept - perlfunc alarm - perlfunc atan2 - perlfunc bind - perlfunc binmode - perlfunc bless - perlfunc break - perlfunc caller - perlfunc chdir - perlfunc chmod - perlfunc chomp - perlfunc chop - perlfunc chr - perlfunc chroot - perlfunc close - perlfunc closedir - perlfunc connect - perlfunc continue - perlfunc cos - perlfunc crypt - perlfunc dbm - perlfunc defined - perlfunc delete - perlfunc die - perlfunc do - perlfunc dump - perlfunc each - perlfunc eof - perlfunc eval - perlfunc evalbytes - perlfunc exec - perlfunc exists - perlfunc exit - perlfunc exp - perlfunc fc - perlfunc fcntl - perlfunc __FILE__ - perlfunc fileno - perlfunc flock - perlfunc fork - perlfunc formats - perlfunc getc - perlfunc getpeername - perlfunc getpgrp - perlfunc getppid - perlfunc getpriority - perlfunc get and set - perlfunc getsock - perlfunc glob - perlfunc gmtime - perlfunc goto - perlfunc grep - perlfunc hex - perlfunc import - perlfunc index - perlfunc int - perlfunc ioctl - perlfunc join - perlfunc keys - perlfunc kill - perlfunc last - perlfunc lc - perlfunc lcfirst - perlfunc length - perlfunc __LINE__ - perlfunc link - perlfunc listen - perlfunc local - perlfunc localtime - perlfunc lock - perlfunc log - perlfunc lstat - perlfunc m// - perlfunc map - perlfunc mkdir - perlfunc msg* - perlfunc my - perlfunc next - perlfunc no - perlfunc oct - perlfunc open - perlfunc opendir - perlfunc ord - perlfunc our - perlfunc pack - perlfunc package - perlfunc __PACKAGE__ - perlfunc pipe - perlfunc pop - perlfunc pos - perlfunc print - perlfunc printf - perlfunc prototype - perlfunc push - perlfunc quoting - perlfunc qr (Perl) rand - perlfunc read - perlfunc readdir - perlfunc readline - perlfunc readlink - perlfunc readpipe - perlfunc recv - perlfunc redo - perlfunc ref - perlfunc rename - perlfunc requires - perlfunc reset - perlfunc return - perlfunc reverse - perlfunc rewinddir - perlfunc rindex - perlfunc rmdir - perlfunc s/// - perlfunc say - perlfunc scalar - perlfunc seek - perlfunc seekdir - perlfunc select - perlfunc semget - perlfunc semop - perlfunc send - perlfunc setpgrp - perlfunc setpriority - perlfunc setsockopt - perlfunc shift - perlfunc shm* - perlfunc shutdown - perlfunc sin - perlfunc sleep - perlfunc sockets - perlfunc sort - perlfunc splice - perlfunc split - perlfunc sprintf - perlfunc sqrt - perlfunc srand - perlfunc state - perlfunc study - perlfunc sub - perlfunc __SUB__ - perlfunc substr - perlfunc symlink - perlfunc syscall - perlfunc sys* - perlfunc system - perlfunc syswrite - perlfunc tell - perlfunc telldir - perlfunc tie - perlfunc time - perlfunc times - perlfunc tr/// - perlfunc truncate - perlfunc uc - perlfunc ucfirst - perlfunc undef - perlfunc unlink - perlfunc unpack - perlfunc unshift - perlfunc untie - perlfunc use - perlfunc utime - perlfunc values - perlfunc vec - perlfunc wait - perlfunc waitpid - perlfunc wantarray - perlfunc warn - perlfunc write - perlfunc y/// - perlfunc Special Variables (Perl) $_ (Perl) @_ (Perl) $" (Perl) $$ (Perl) $0 (Perl) @INC (Perl) %INC (Perl) Futures switch (given) case statements (given) perldoc (FAQ) Property Member Slot
Phasers
will trait BEGIN CHECK INIT END ENTER LEAVE KEEP UNDO PRE POST FIRST NEXT LAST CATCH CONTROL COMPOSE
Postcircumfix operators
array indexing operator array subscript operator hash indexing operator hash subscript operator
Postfix operators
postfix ++ postfix --
Pragmas
v6.x MONKEY-GUTS MONKEY-SEE-NO-EVAL MONKEY-TYPING MONKEY dynamic-scope experimental fatal internals invocant isms lib newline nqp parameters precompilation soft strict trace v6 variables worries
Prefix operators
prefix ++ prefix -- Negative numeric context operator String context operator Integer bitwise negation operator Boolean bitwise negation operator upto operator
Programs
command line arguments MAIN command-line argument bundling rakudoc RAKUDOLIB RAKULIB PERL6LIB RAKUDO_MODULE_DEBUG RAKU_EXCEPTIONS_HANDLER PERL6_EXCEPTIONS_HANDLER RAKUDO_NO_DEPRECATIONS RAKUDO_DEPRECATIONS_FATAL RAKUDO_VERBOSE_STACKFRAME RAKUDO_BACKTRACE_SETTING RAKUDO_PREFIX RAKUDO_PRECOMP_DIST RAKUDO_PRECOMP_LOADING RAKUDO_PRECOMP_WITH RAKUDO_LOG_PRECOMP RAKUDO_LINE_EDITOR RAKUDO_DISABLE_MULTILINE RAKUDO_HIST RAKUDO_DEFAULT_READ_ELEMS RAKUDO_ERROR_COLOR RAKUDO_MAX_THREADS TMPDIR TEMP TMP PATH RAKUDO_SNAPPER RAKUDO_HOME NQP_HOME rakuw.exe rakudow.exe
Reference
RAKULIB Overriding default gist method supply (on-demand) named-anywhere hidden-from-USAGE unit (MAIN) Raku and Perl 6 (FAQ) v6.d (FAQ) Rakudo Star DMG binary installer (FAQ) Rakudo Star MSI binary installer (FAQ) Rakudo Star docker image (FAQ) Rakudo Star for Linux (FAQ) Rakudo Star for Windows (FAQ) Rakudo Star for Mac (FAQ) rakubrew (FAQ) rakudobrew (FAQ) Books Specification (FAQ) Ruby Quickstart (FAQ) CPAN (FAQ) ecosystem p6doc (FAQ) Perl modules (FAQ) C and C++ (FAQ) Core standard library (FAQ) Rakudo Star distribution and compiler-only release (FAQ) Precompile (FAQ) Circular dependencies (FAQ) Data::Dumper (FAQ) Junction (FAQ) Sigils (FAQ) Coroutine (FAQ) Raku Implementation (FAQ) NQP (FAQ) Raku Distribution (FAQ) Rakudo Star release cycle (FAQ) Abstract Class Advent Calendar Anonymous API Apocalypse Arity Backtracking binder block bytecode Camelia Colon Pair Colon List Community Damian Conway decont diffy Exegesis forward declaration fiddly Handle Huffmanize iffy import instance Interface Invocant IRC IRC lingo ALAP autopun backlog Bot compunit (glossary) compilation unit DWIM flap fossil FSVO FTFY gradual typing IIRC IMHO IWBN LHF LGTM LTA NST Opt PB PR P5 P6 RSN RT TIMTOWTDI TMI TMTOWTDI UGT WFM WIP WP WW Larry Wall Lexing Literal LHS lvalue Mainline Mayspec MoarVM Multi-Dispatch MMD multi-method Née NFG Niecza NQP Not Quite Perl NYI opcode Operator Parse Tree Parameter Parrot PAST Perl Perl 6 PERL POD POV Propspec Pull request property pugs QAST Rakudo Reify Repository RHS roast role rvalue SAP Semilist Sigil Sigilless Variable Spesh STD Stub Symbol Synopsis Syntax Analysis test suite TheDamian TimToady Token Thunk Tight Loose twine Type Objects Type Smiley value UB Value type Variable Variable Interpolation Virtual Machine WAT whitespace 6model Running programs Build.pm6 META6.json zef Pointer CArray methods :$translate-nl :nl-out MY (package) OUR (package) CORE (package) GLOBAL (package) PROCESS (package) COMPILING(package) CALLER (package) CALLERS (package) DYNAMIC (package) OUTER (package) OUTERS (package) LEXICAL (package) UNIT (package) SETTING (package) PARENT (package) CLIENT (package) CStruct CPPStruct CPointer CUnion P6opaque Enumeration Enums Normalization NFC UTF8-C8 UTF-8 Clean-8 « » × ÷ π τ 𝑒 ¯ ¹ ² ³ ⚛= ⚛+= ⚛-= ⚛−= ++⚛ ⚛++ --⚛ ⚛-- »=» «=« «=» »=« XCompose ibus Xkb WinCompose Vim Emacs NativeEndian LittleEndian BigEndian Endian windows-1252 windows-1251 windows-932 iso-8859-1 ascii ShiftJIS utf16-le utf16-be utf16 utf-16 utf16le utf16be File locking SeekFromBeginning SeekFromCurrent SeekFromEnd tty IterationEnd Cursor DESTROY metamodel NaN (definition) Less Same More return-rw variadic Signal SlurpySentry
Regexes
TOP ws Actions . \n \N \t \T \h \H \v \V \s \S \d \D \w \W \c \C \x \X <:property> <[ ]> <-[ ]> + * ? (quantifier) ** % %% ? || | && & ^ $ ^^ $$ <|w> \b \B << >> « » positive lookaround assertion negative lookaround assertion ?[ before after ( ) [ ] :my :our Named captures <( )> \K S/// non-destructive substitution tilde ~ SETGOAL FAILGOAL recursive tilde tilde ~~ <~~> Regex Interpolation $variable $(code) <$variable> <{code}> Regex adverbs
Subroutines
foo ARGS-TO-CAPTURE RUN-MAIN GENERATE-USAGE callsame callwith nextsame nextwith samewith nextcallee sub EXPORT does-ok dd run
Syntax
^methods sub -> multi proto only prefix & token rule :sym<> grammar :{} [ ] (typed array) need use require use lib WHAT WHICH WHO WHERE HOW WHY DEFINITE VAR HAS class self role does but method call methodop .& mutating method call methodop .^ methodop .? methodop .+ methodop .* methodop ». methodop >>. .( ) .[ ] .{ } list = :: ::() ::($c).m A."$m"() #| #= Q 「 」 escaping quote q ' ' qq " " \ (quoting) & (interpolation) qw word quote < > word quote qww qqw qqww << >> « » qx qqx heredocs :to / / rx m s/ / / regex lazy (statement prefix) eager (statement prefix) hyper (statement prefix) race (statement prefix) quietly (statement prefix) try (statement prefix) do (statement prefix) sink (statement prefix) react (statement prefix) flattening \ Unspace Embedded comments String (literals) 0b (radix form) 0d (radix form) 0o (radix form) 0x (radix form) Number (literals) Number literals Pairs (literals) Pair literals Boolean (literals) unit module package constant (Terms) ... (forward declaration) method (declarator) only method enum subset :ver<> :auth<> :api<> \c[] unicode name $ @ % (sigil) & is (type of variable) \ (sigilless variables) Twigil $* * $* @* %* &* $? ? $? @? %? &? ! $! @! %! &! . $. @. %. &. ^ $^ @^ %^ &^ : $: @: %: &: = $= @= %= &= $~ supersede constant (Prefix) @ list contextualizer $ (item contextualizer) <-> True False capture literal (Capture) \() (Capture) Grapheme () (empty list) *%_ (extra named arguments) Inf (definition) ∞ (definition) : => :! :$ \ (sigilless scalar) signature literal :() :D :U :_ --> Return type arrow *@ *% **@ + (Single argument rule slurpy) | my (Sub) our (Sub) trait_mod (declarator) v (version) * literal Whatever literal Whatever-currying
Terms
qw quote-words grouping operator block constructor hash constructor empty set
Traits
is tighter is equiv is looser is assoc is native is repr is nativesize is (trait) Uninstantiable representation trait is implementation-detai handles trait is (class) is rw (class) is default (Attribute) is required (Attribute) is DEPRECATED (Attribute) is rw (Attribute) is built (Attribute) is default (Routine) is copy is rw is raw is readonly is default (Variable)
Tutorial
v6 (Basics) statement (Basics) my (Basics) block (Basics) sigils (Basics) identifiers (Basics) scalar (Basics) filehandle (Basics) assignment (Basics) string literal (Basics) array (Basics) method (Basics) invocant (Basics) hash (Basics) for (Basics) Any (Basics) += (Basics) fat arrow (Basics) pair (Basics) autovivification (Basics) postincrement (Basics) preincrement (Basics) topic variable (Basics) variable interpolation (Basics) double-quoted strings single-quoted strings OOP class state class state attributes encapsulation has twigils ! & . accessors accessor methods is rw class variables methods invocant FQN Private methods Constructor bless TWEAK BUILD submethod DESTROY DESTROY type object DEFINITE inheritance also declarator USAGE $*USAGE resume (Exceptions) int uint num str
Types
traits is built traits is required static CStruct (native representation) CArray int @ num @ str @ int8 int16 int32 int64 uint8 uint16 uint32 uint64 num32 num64 byte void type (NativeCall) blob8 blob16 blob32 blob64 buf8 buf16 buf32 buf64 Encoding::Encoder Encoding::Decoder FileChangeEvent (enum) FileChanged (FileChangeEvent) FileRenamed (FileChangeEvent)
Variables
%*SUB-MAIN-OPTS @_ %_ $~MAIN $~Quote $~Quasi $~Regex $~Trans $~P5Regex $ (variable) $0 $1 $ $?FILE $?LINE ::?CLASS %?RESOURCES $?PACKAGE $?MODULE $?CLASS $?ROLE $?TABSTOP $?NL &?ROUTINE &?BLOCK $?DISTRIBUTION $*ARGFILES @*ARGS &*ARGS-TO-CAPTURE &*GENERATE-USAGE $*IN $*OUT $*ERR %*ENV $*REPO $*INIT-INSTANT $*TZ $*CWD $*KERNEL $*DISTRO $*VM $*RAKU $*PERL $*PID $*PROGRAM-NAME $*PROGRAM &*EXIT $*EXECUTABLE $*EXECUTABLE-NAME $*USAGE $*USER $*GROUP $*HOMEDRIVE $*HOMEPATH $*HOME $*SPEC $*TMPDIR $*THREAD $*SCHEDULER $*SAMPLER $*DEFAULT-READ-ELEMS $*COLLATION $*RAT-OVERFLOW $*TOLERANCE
infix
þ