What purpose does each of the following serve: -w, strict, -
T ?

Answers were Sorted based on User's Feedback



What purpose does each of the following serve: -w, strict, - T ? ..

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

What purpose does each of the following serve: -w, strict, - T ? ..

Answer / kalai

-w enables the warnings mode in perl

-T is enables the Taint mode it performs some checks how
your program is using the data passed to it

-w, -T,-d, -D are called the command line switches

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

What is the purpose of “_file_ literal” and “_line_ literal” in perl?

0 Answers  


What is the importance of perl warnings?

0 Answers  


Explain USE and REQUIREMENT statements?

0 Answers  


write a script to display mirror image of a entered value and also check whether Palindrome

3 Answers   HCL, Persistent,


What?s your favorite module and why?

3 Answers  






What are the logical operators used for small scale operations?

0 Answers  


How to access parameters passed to a subroutine in perl?

0 Answers  


How to make the following assignment, as arrayreference assignment ? my $arr_ref='[1,2,3,4,4,'elem']';

2 Answers  


Which guidelines by Perl modules must be followed?

0 Answers  


Define operators used in perl?

0 Answers  


What is the purpose of redo statement?

0 Answers  


What is the use of strict?

0 Answers  


Categories