What purpose does each of the following serve: -w, strict, -
T ?
Answers were Sorted based on User's Feedback
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 |
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 |
Why do you program in Perl?
How do you debug a Perl scripting ( at the compile time error or run time error) in Unix environment ?
How can we create perl programs in unix, windows nt, macintosh and os/2 ?
Where the command line arguments are stored and if you want to read command-line arguments with Perl, how would you do that?
Distinguish my and local?
Explain the difference between declarations of 'my' and 'local' variable scope in perl?
What is posix in perl?
What are the various file operations in perl. Explain with example.
Explain lists in perl?
What is the purpose of redo statement?
How can the user execute a long command repeatedly without typing it again and again?
What is perl programming?