What does the command "use strict" do and why should you
use it?
Answer Posted / savitha sridhar
strict is a pragma that can be used to enforce Strict
programming practices while you write your programs.
Eg: You can write a program like this:
$x=100
print $x
But if you use strict pragma, then you have to be very
specific while using variables
use strict;
my $x=100; ##look at the usage of scope like my,local,our
print $x;
Pragma usage can also be used as a toggle
use strict;
my $x=100;
print $x;
no strict; # to toggle strict to "No"
$y=200; ##no need to use scope as strict is disabled
print $y;
Is This Answer Correct ? | 17 Yes | 0 No |
Post New Answer View All Answers
What is use of ‘->’ symbol?
Elaborate on perl bite-wise operators.
How to read from a pipeline with Perl
What is the function of virtual documents in cgi programs?
How can you call a subroutine and identify a subroutine?
Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.
What are numeric operators in perl?
What are the various uses of perl?
What does `new $cur->{LINK}' do? (Assume the current package has no new() function of its own.)
What is the use of -w, -t and strict in Perl?
Can we load binary extension dynamically?
What does the qx{ } operator do?
How to create a package?
Explain the meaning of perl one-liner?
what is the function of Return Value?