Course of Raku / Advanced / Modules / Packages and namespaces 🆕 / Packages and modules
Quiz — Packages
What does the following program print?
module M {
my $x = 5;
}
say $M::x.defined;| 1 | False |
| 0 | True |
| 0 | 5 |
| 0 | An error |
$x is declared with my, so it is lexical
and never enters the M namespace. The path
$M::x therefore finds nothing — an undefined value — and
.defined is False. Only an our
variable would be reachable this way.