An erlang module is a file with couple of functions grouped together. This file usually has .erl
extension.
A "Hello World" module with name hello.erl
is shown below
-module(hello).
-export([hello_world/0]).
hello_world() ->
io:format("Hello, World!~n", []).
In the file, it is required to declare the module name. As shown before in line 1. The module name and file name before .erl
extension must be same.