πŸ“˜ Built-in types in Perl 6

πŸ“˜ Built-in types in Raku

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


Perl 6 allows using typed variables. To tell the compiler that the variable is typed, you simply need to name the type while declaring the variable.

Some of the types available in Perl 6 are obvious and do not need comments:

Bool, Int, Str
Array, Hash, Complex

Some might require a small comment:

Num, Pair, Rat

The Num type is used to handle floating-point variables, and a Pair is a β€œkey; value” pair. The Rat type introduces rational numbers with numerators and denominators.

Leave a Reply

Your email address will not be published. Required fields are marked *

Retype the CAPTCHA code from the image
Change the CAPTCHA codeSpeak the CAPTCHA code