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 I print the entire contents of an array with Perl?
What are perl variables?
how to connect cisco switch uisng perl script
If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?
Explain the execution of a program in perl.
There is no strict data types in perl unlike in other high level languages like Java so wouldn't that be a problem if a code in perl is to be a written by a big team of 20+ members ?"
You want to download the contents of a url with perl. How would you do that?
How many types of primary data structures in Perl and what do they mean?
What is the closure in PERL?
How to prevent file truncation in perl?
What is the difference between perl list and perl array?
Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.
What is subroutine in perl?
How do I sort a hash by the hash key?
How do I debug a perl program?