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 do you match one letter in the current locale?
What is use of ‘->’ symbol?
Is perl compiler or interpreter?
Which functions in perl allows you to include a module file. State their differences.
Explain goto label?
What are the steps involved in configuring a server using cgi programming?
You want to add two arrays together. How would you do that?
What is the use of command “use strict”?
How to remove a directory in perl?
Elaborate on perl bite-wise operators.
Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.
Explain perl one-liner?
What is “grep” function in perl?
What are some of the key features of objects in perl?
You want to download the contents of a url with perl. How would you do that?