Type - Perl 6 types
my $class = Class.new("SomeClass"); my $type = Type.new(Class.new("SomeClass")); $class.apply; $type =:= ::SomeClass; # true
Every variable in Perl 6 has a type. This type can be accessed using the .ref method, which is available on any type, boxed or unboxed.
.ref
These objects are what you get from ::SomeClass references.
::SomeClass
Note that this could be a different entity to the objects that are created when you use;
type Bar; subtype Foo of Str where { rx/^Foo/ };
It is probably bad to have both a MetaClass called Type and a language object called Type. Perhaps this module should be called something else like t, or maybe the type keyword actually creates one of these objects.
Type
t
type
To install Perl6::Pugs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl6::Pugs
CPAN shell
perl -MCPAN -e shell install Perl6::Pugs
For more information on module installation, please visit the detailed CPAN module installation guide.