<br><div class="gmail_quote">On Mon, Nov 15, 2010 at 4:48 PM, john thornton <span dir="ltr">&lt;<a href="mailto:jdthornton@ozemail.com.au">jdthornton@ozemail.com.au</a>&gt;</span> wrote:<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
The only part that confuses me is that if<br>
<br>
# is a comment<br>
<br>
then why does the shebang line have any influence:<br>
<br>
#!/usr/bin/perl<br>
<br>
or as a variant to show warnings for code<br>
<br>
#!/usr/bin/perl -w<br>
<br></blockquote><div><br>The shebang line is treated like a comment by the perl interpreter if invoked via <br>   perl <a href="http://yourscript.pl">yourscript.pl</a><br><br>

But not by the OS when ivoked via <br>   ./<a href="http://yourscript.pl">yourscript.pl</a><br><br>

On a linux system, when you invoke a script from the command line, your 
OS looks for a shebang line to see what interpreter it should use for 
your script. This could be perl (#!/usr/bin/perl) or bash (#!/bin/bash),
 or any of hundreds of others. The -w switch is passed to the 
interpreter in this case.<br>

 The same applies for a CGI. Apache, for example, looks for a shebang 
line to see which interpreter should be invoked to run your CGI. It is 
also possible to write a CGI in bash and use <br>

<br>

          #!/bin/bash <br>

<br>

as the shebang line. Or any other interpreter for that matter.<br><br></div></div><br>The above doesn&#39;t apply to Windows, however. <br><br>Hope this clears it up a bit.<br><br>Leigh.<br><br>