Tags
There are no tags for this page.
Attachments
Perl 6
WITCH hat
Mnemonics
"hat", "disjunct", "but not", "upto"
-- Used when something "wears many hats"
-- Also used in exclusive or and other disjunctions (you can only wear one hat at a time)
Used alone
^ Before a value, the upto operator (a Bartholomew Cubbins hat)
^ Before a package name is shorthand for introspection (lets you see its hat collection.)
^ In a junction creates a one() junction
Operators containing this character
~^ and +^ and ?^ An exclusive or bitwise operation (or an invert, if only one argument)
^ placed on either or both ends of a range (..) or flip-flop range (ff or fff) to exclude (or "cap") the endpoints
.^ as a method is also for introspection
^^ tight logical exclusive-or
When used inside regexes
^ Matches the start of a string
^^ Matches the start of a line
Special Variables
Variable names starting with hats inside a pointy block or sub are placeholder variables
Method names declared with hats are metaclass methods
Other Uses
Method names starting with hats are metaclass methods
Old, deprecated, or other language uses
^ was bitwise exclusive or in Perl 5. In Perl 6 that's ~^, +^, or ?^ for bitwise, and ^^ in logic.
Lots of special variables in Perl 5 started with ^. Not only are those gone, but placeholders cannot have single uppercase names
|