"use warnings" or "-w"

  • Thread starter Rohan Romanus Almeida
  • Start date
R

Rohan Romanus Almeida

Hi,

Wanted a little help regarding "use warnings".

AFAIK, there are the following choices:

1) #!/usr/bin/perl -w

In this mode, the perl interpreter is started with "-w",
as a command line option.
But if the user knows the absolute path of the perl script,
then he can execute,
$ perl /path/to/perlscript

So, does he bypass the "-w" option?

2) #!/usr/bin/perl
use warnings;

I think this is the bestest choice!


I normally begin my perl scripts with the following 2 lines:

#!/usr/bin/perl
use strict; use warnings;

Is this safe?
What do most of you people use?

Thankz.
 
S

Sam Holden

Hi,

Wanted a little help regarding "use warnings".

AFAIK, there are the following choices:

1) #!/usr/bin/perl -w

In this mode, the perl interpreter is started with "-w",
as a command line option.
But if the user knows the absolute path of the perl script,
then he can execute,
$ perl /path/to/perlscript

So, does he bypass the "-w" option?

No.

Of course you could have tried it youself and known the answer without
asking...
 
T

Tad McClellan

Rohan Romanus Almeida said:
1) #!/usr/bin/perl -w

In this mode, the perl interpreter is started with "-w",
as a command line option.
But if the user knows the absolute path of the perl script,
then he can execute,
$ perl /path/to/perlscript

So, does he bypass the "-w" option?


What happened when you tried it?

2) #!/usr/bin/perl
use warnings;

I think this is the bestest choice!


<aol> Me too! </aol> But not because of how the program is invoked.

It is because lexical warnings are better than global warnings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top