The keyword module declares a module. The name of the module is given after the keyword. There are two methods of scoping the module. Either it can be a bare directive in the beginning of a file, or the whole module can be scoped in the code block within the pair of braces.
In the first option, the rest of the file is the module definition (note the presence of the unit keyword).
unit module X;ย sub x() { ย ย ย say "X::x()"; }
In the second option, the code looks similar to the way you declare classes (more on classes in Chapter 4).
module X { ย ย ย sub x() { ย ย ย ย ย ย ย say "X::x()"; ย ย ย } }