very starting help

very starting help

am 18.07.2011 07:34:14 von anant mittal

--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--

Re: very starting help

am 18.07.2011 08:12:20 von Alan Haggai Alavi

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@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: very starting help

am 18.07.2011 09:43:15 von Christian Walde

On Mon, 18 Jul 2011 07:34:14 +0200, anant mittal 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. :)

--=20
With regards,
Christian Walde

--=20
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: very starting help

am 18.07.2011 10:23:16 von Christian Walde

On Mon, 18 Jul 2011 10:19:00 +0200, Chankey Pathak =
wrote:

> @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.

--=20
With regards,
Christian Walde

--=20
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/