Course of Raku / Advanced / Control flow / Statement prefixes 🆕 / sink and quietly

Quiz — Statement prefixes

What does the following program print?

my $v;
quietly {
    say $v + 10;
}
0A warning, then 10
110
0Nil
00

Adding 10 to the undefined $v treats it as 0, giving 10. Normally this would also print an “uninitialized value” warning, but the quietly prefix suppresses that, so only 10 is printed.

Course navigation

← sink and quietly   |   The value of a do block →