Programming is not an intuitive job, people are not programmed from birth, so there is different ways to be intuitive for different people. For example I see nothing intuitive to mix escript code and code for OTP. If you want to use common library in OTP application and escript, put following line after shebang line:<div>
%%! -pa path/to/library<br><br><div class="gmail_quote">On 30 September 2011 09:07, Andrew Pennebaker <span dir="ltr"><<a href="mailto:andrew.pennebaker@gmail.com">andrew.pennebaker@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
No. erl should ignore shebang lines, because that's easy to do in a parser, and it makes the language more intuitive to program in.<div class="im"><br clear="all"><div><br></div>Cheers,<div><br></div><div>Andrew Pennebaker</div>
<div><a href="http://www.yellosoft.us" target="_blank">www.yellosoft.us</a></div>
<br></div><div><div></div><div class="h5"><div class="gmail_quote">On Thu, Sep 29, 2011 at 9:33 PM, Maxim Treskin <span dir="ltr"><<a href="mailto:zerthurd@gmail.com" target="_blank">zerthurd@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You should not compile this script, just run. Remove first line If you want compile it as regular erlang module.<br><br><div class="gmail_quote"><div><div></div><div>On 30 September 2011 01:25, Andrew Pennebaker <span dir="ltr"><<a href="mailto:andrew.pennebaker@gmail.com" target="_blank">andrew.pennebaker@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>Please instruct erl to ignore shebangs.<div><br></div><div><div>$ cat hello.erl </div>
<div>#!/usr/bin/env escript</div>
<div><br></div><div>-module(hello).</div><div>-export([main/1]).</div><div><br></div><div>main(_) -> io:format("Hello World!~n", []).wonko:Desktop andrew$ ./hello.erl </div>
<div>Hello World!</div><div>wonko:Desktop andrew$ erl</div><div>Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]</div><div><br></div><div>Eshell V5.8.4 (abort with ^G)</div>
<div>1> c(hello).</div><div>./hello.erl:1: syntax error before: '#'</div><div>./hello.erl:4: no module definition</div><div>error</div><div><br></div>Cheers,<div><br></div><font color="#888888"><div>Andrew Pennebaker</div>
<div><a href="http://www.yellosoft.us/" target="_blank">www.yellosoft.us</a></div>
</font></div>
<br></div></div>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Maxim Treskin<br>
</font></blockquote></div><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Maxim Treskin<br>
</div>