Course of Raku / Advanced / Modules

Modules basics

A module is a file of reusable code — subroutines, variables, and more — that other programs can load and share. This section covers the essentials in three steps: how to write a module and mark what it makes available, how a program loads one with use, and how importing brings a module’s names into your scope.

Topics in this section

Practice

Complete the quizzes that cover the contents of this section.

Exercises

This section contains 7 exercises. Examine all the topics of this section before doing the coding practice.

  1. A maths module
  2. A shout module
  3. Two functions in one module
  4. Use the converter
  5. Use a stats module
  6. Read the constant
  7. Load at run time

Course navigation

Modules   |   Creating modules