Elixir files generally have .ex extension. And if you are not planning to compile it, we recommend using the .exs file. We cover those differences in our getting started guide.
Assuming you write the file above to "mod.exs", one of the ways to achieve what you want is:
elixir -r mod.exs -e "MyModule.print"