<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.30.3">
</HEAD>
<BODY>
Sorry -- correction below<BR>
<BR>
On Mon, 2010-11-15 at 17:09 +1100, Alec Clews wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
On Mon, 2010-11-15 at 16:48 +1100, john thornton wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Thanks very much for that. I went to the site and downloaded the perl
training book. Perldocs...so many.
The only part that confuses me is that if
# is a comment
then why does the shebang line have any influence:
#!/usr/bin/perl
or as a variant to show warnings for code
#!/usr/bin/perl -w
I am using to using # to "comment out" configuration files in Linux
for setting up mysql and so on.
</PRE>
</BLOCKQUOTE>
<BR>
the shebang notation (#!) is specific to UNIX (and hence Linux)<BR>
<BR>
The #! is actually interpreted by the kernel and tells it which interpreter to use (in this case Perl)<BR>
<BR>
Perl ignores the line[1]<BR>
<BR>
See also <A HREF="http://en.wikipedia.org/wiki/Shebang_(Unix)">http://en.wikipedia.org/wiki/Shebang_(Unix)</A><BR>
<BR>
<BR>
[1] That was a lie. As a special case Perl will look at the line and use any flags it sees. e.g.<BR>
<BR>
#!/bin/env perl -p<BR>
</BLOCKQUOTE>
#! /usr/bin/env perl -p<BR>
<BR>
NB using this form of shebang is (supposedly) more portable, although I have had problems on some systems....<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<BR>
will switch on the pseudo sed mode<BR>
<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
--
Alec Clews
Personal <<A HREF="mailto:alec.clews@gmail.com">alec.clews@gmail.com</A>> Melbourne, Australia.
Jabber: <A HREF="mailto:alecclews@jabber.org.au">alecclews@jabber.org.au</A> PGPKey ID: 0x9BBBFC7C
Blog <A HREF="http://alecthegeek.wordpress.com/">http://alecthegeek.wordpress.com/</A>
</PRE>
</TD>
</TR>
</TABLE>
<PRE>
_______________________________________________
Melbourne-pm mailing list
<A HREF="mailto:Melbourne-pm@pm.org">Melbourne-pm@pm.org</A>
<A HREF="http://mail.pm.org/mailman/listinfo/melbourne-pm">http://mail.pm.org/mailman/listinfo/melbourne-pm</A>
</PRE>
</BLOCKQUOTE>
<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
--
Alec Clews
Personal <<A HREF="mailto:alec.clews@gmail.com">alec.clews@gmail.com</A>> Melbourne, Australia.
Jabber: <A HREF="mailto:alecclews@jabber.org.au">alecclews@jabber.org.au</A> PGPKey ID: 0x9BBBFC7C
Blog <A HREF="http://alecthegeek.wordpress.com/">http://alecthegeek.wordpress.com/</A>
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>