September 2017
Beginner
402 pages
9h 52m
English
The perl method returns a string that can represent the Rat value as Perl 6 understands it in the source code. The result can either contain a decimal point or a slash, depending on what is better for precise representation of the value.
Consider a couple of examples that display the preceding idea:
my $x = 1/3;say $x.perl; # <1/3>my $y = 1/2;say $y.perl; # 0.5
Even more, the following code is valid Perl 6 code:
say 10/20.perl; # 0.5