Skip to content

Instantly share code, notes, and snippets.

@ten0s
Created February 25, 2015 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ten0s/771b268560e5421b8b57 to your computer and use it in GitHub Desktop.
Save ten0s/771b268560e5421b8b57 to your computer and use it in GitHub Desktop.
Read lines from stdin
read_lines(Acc) ->
case file:read_line(standard_io) of
{ok, Line} ->
Line2 = string:strip(Line, right, $\n),
read_lines([Line2 | Acc]);
eof ->
lists:reverse(Acc)
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment