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
Differentiate between c++ and perl.
What is the use of –w?
What are the steps involved in configuring a server using cgi programming?
Why is it hard to call this function: sub y { "because" } ?
What is use of ‘->’ symbol?
“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?
What does the’$_’ symbol mean?
How interpreter is used in perl?
What are the options that can be used to avoid logic errors in perl?
Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.
What happens when you return a reference to a private variable?
What does 'do' statement do in perl?
What package you use to create a windows services?
What are the various uses of perl?
How do you give functions private variables that retain their values between calls?