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
Explain about the applications of perl?
Write a script to reverse a string without using perl's built in functions?
What is perl programming?
How to close a directory in perl?
How will you get the count of parameters passed to a perl subroutine?
Explain the internal working of cgi
How do I read command-line arguments with Perl?
What is confess function in perl?
Explain the execution of a program in perl.
what is the function of Return Value?
Explain what is the scalar data and scalar variables in Perl?
What value is returned by a lone `return;’ statement?
How to create a directory in perl?
You want to concatenate strings with perl. How would you do that?
Define operators used in perl?