Let’s modify our Hello World program.
Instead of writing “Hello World” as the output, we want it to write “Hello Name” where name is a parameter we provide to the function hello_world.
The original code is the following:
Since we want to pass a parameter, we have to modify the export line as follows:
Then we have to instruct the hello_world function to handle the parameter:
save the file and run the erlang shell.
compile the program:
and then, run it