What purpose does each of the following serve: -w, strict, -
T ?
Answer Posted / savitha sridhar
-w to enable warnings mode
-T to enable Taint mode (TAINT mode puts a Perl script
into "PARANOID" mode and treats ALL user supplied input as
tainted and bad unless the programmer explicitly "OKs" the
data). Usually used when you are using a perl script that
you have downloaded and running but do not want any
security problems.
strict is a pragma in perl used to incorporate strict
programming practices.
Eg:
you could have written a small prog like this:
$x=100;
print $x;
with strict pragma "ON" you will be explicitly required to
specify the scope like,
use strict;
my $x=100; ##use of my to specify scope
print $x;
You can also switch off a pragma by using "no" like below
to switch off the pragma effect:
use strict;
my $x=100; ##use of my to specify scope
print $x;
no strict;
$y=200; ##no need to be specific
print $y;
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How to check the status of airplane mode (enable/disable) in perl for Android mobile?
What does 'do' statement do in perl?
What are the different ways to run cgi?
Differences between die and exit.
How do I replace every character in a file with a comma?
What is the use of 'ne' operator?
What is the closure in PERL?
What is perl shift array function?
What is it meants by '$_'?
What are the various uses of perl?
Define print() function in perl?
What are prefix dereferencer? List them.
What is 'commit' command in perl?
How to deleting an existing file in perl programming?
Write a program to decode the data in the form using cgi programming