running from a shell:
max [ ~/src/erlang/hello ]$ erl Erlang/OTP 18 [erts-7.2.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.2.1 (abort with ^G) 1> c(hello). {ok,hello} 2> hello:start(). test ok 3>
running compiled erlang code:
erlc hello.erl
(writes hello.beam)
erl -noshell -s hello start -s init stop
"-s hello start" causes hello:start(). to be called
"-s init stop" causes init:stop(). to be called after the previous finishes
(otherwise erl will hang)
https://github.com/blackberry/Erlang-OTP/blob/master/lib/kernel/src/inet_udp.erl