very starting help

--bcaec51a750686768a04a85159b0
Content-Type: text/plain; charset=ISO-8859-1

hello
I am using strawberry perl.
Very first line i encountered to write while coding is "#! /user/bin/perl
-w". It is where interpreter exists. What does this mean. Is this path is
same always.perl is installed in c drive but i am writing programs in other
drive. Is it still same.
please help me.

--bcaec51a750686768a04a85159b0--
anant mittal [ Mo, 18 Juli 2011 07:34 ] [ ID #2062182 ]

Re: very starting help

Hello Anant,

#!/usr/bin/perl is a *shebang* and is useful only in unix-like systems where
it refers to the location of the interpreter. Under other systems the
interpreter ignores this line as a comment. Shebang lines are useful to
execute a script directly without having to specify the interpreter.

Consider a script named main.pl which can be executed under unix-like systems
as:

perl main.pl

or

../main.pl # system checks the shebang line for the interpreter to use

For more information: http://en.wikipedia.org/wiki/Shebang_(Unix)

Regards,
Alan Haggai Alavi.
--
The difference makes the difference.

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Alan Haggai Alavi [ Mo, 18 Juli 2011 08:12 ] [ ID #2062183 ]

Re: very starting help

On Mon, 18 Jul 2011 07:34:14 +0200, anant mittal <perl.anant [at] gmail.com> w=
rote:

> -w

Just a quick note: Please do not use -w in the hashbang, it forces warnin=
gs everywhere, even when modules didn't want warnings. You'll get weird e=
rror messages if you leave that in. Instead just write "use warnings;" at=
the top of your code and you'll be fine. :)

--
With regards,
Christian Walde

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Christian Walde [ Mo, 18 Juli 2011 09:43 ] [ ID #2062184 ]

Re: very starting help

On Mon, 18 Jul 2011 10:19:00 +0200, Chankey Pathak <chankey007 [at] gmail.com>=
wrote:

> [at] Christian wale: Why not to use -w for using warning everywhere?
>
> It's good to use warnings everywhere for a good program, isn't it?

Simply put:

It activates warnings for code you did not write.

It is an extremely good idea to enable warnings for all code you write yo=
urself. However if you enable it for code written by authors who did not =
want warnings, or for old modules, then you will get pointless messages y=
ou cannot fix.

--
With regards,
Christian Walde

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Christian Walde [ Mo, 18 Juli 2011 10:23 ] [ ID #2062185 ]
Perl » gmane.comp.lang.perl.beginners » very starting help

Vorheriges Thema: environment variables in perl
Nächstes Thema: Counting Word Occurances