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
How do you you check the return code of a command in perl?
Does Perl have reference type?
What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?
Explain tk?
How are parameters passed to subroutines in perl?
what are the two ways to get private values inside a subroutine or block?
How to replace perl array elements?
Explain goto expr?
Write a program that shows the distinction between child and parent process?
How do I debug a perl program?
Differentiate between arrays and list in perl.
What is the closure in PERL?
How to remove a directory in perl?
List the files in current directory sorted by size ?
Explain lists and ivalue?