Modules define namespaces (like packages in Perl).
module Foo x = 42 end puts Foo.x # prints 42
Just as in Perl, we can put a bunch of definitions in one file:
module MyMath PI = 3.14159 def MyMath.square(x) return x * x end end
and use them in another file:
require "MyMath" puts MyMath.square(MyMath::PI) # prints 9.869587728