📘 Method postfix operator .^ in Perl 6

📘 Method postfix operator .^ in Raku

N. B. Perl 6 has been renamed to Raku. Click to read more.


.^method calls a method on the object’s metaobject. A metaobject is an instance of the HOW class and contains some additional information about the object. The following two operations, applied to the $i variable, are equivalent and print the list of the methods available for the Int variables.

my Int $i;
say $i.^methods();
say $i.HOW.methods($i);

Leave a Reply