Experimental features

Preview of upcoming new language features available for user evaluation

During Perl 6 development, new features are often made available for users to experimental with before their design is completed. Eventually these features may be made part of the Perl 6 specification. To use these features, one uses the experimental pragma in program source code, for example, like this:

use experimental :macros;

Following is a list of current experimental features and a short description of each feature's purpose or a link to more details about its use. (Note: Features marked "[TBD]" are to be defined later.)


As of Rakudo 2018.11, there is no longer any need to use experimental :collation any more, as the feature standardized.

The collate and «&infix:<coll>» methods are no longer experimental. However, they are affected by the $*COLLATION, which configures the four collation levels. While the Primary, Secondary and Tertiary mean different things for different scripts, for the Latin script used in English they mostly correspond with Primary being Alphabetic, Secondary being Diacritics and Tertiary being Case.

In the example below you can see how when we disable tertiary collation which in Latin script generally is for case, and also disable quaternary which breaks any ties by checking the codepoint values of the strings, we get Same back for A and a:

use experimental :collation;
$*COLLATION.set(:quaternary(False), :tertiary(False));
say 'a' coll 'A'#OUTPUT: «Same␤» 
say ('a','A').collate == ('A','a').collate# OUTPUT: «True␤» 

The $*COLLATION API could change at any time, so use it with caution.