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 to convert arrays into a string in perl?
Explain '->' in perl?
How does polymorphism work in perl? Give an example.
you are required to replace a char in a string and store the number of replacements. How would you do that?
How to get help for perl?
Write a program that shows the distinction between child and parent process?
What are hashes?
What are the advantages and disadvantages of perl language?
What is epoch time in perl?
Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.
Does Perl have objects? If yes, then does it force you to use objects? If no, then why?
How to know whether a key exists or not in perl?
Mention what is cpan?
Differentiate use and require?
What are the reasons that cookie server can’t handle multiple connections?