Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How to convert arrays into a string in perl?

988


Explain '->' in perl?

974


How does polymorphism work in perl? Give an example.

915


you are required to replace a char in a string and store the number of replacements. How would you do that?

977


How to get help for perl?

1040


Write a program that shows the distinction between child and parent process?

982


What are hashes?

994


What are the advantages and disadvantages of perl language?

968


What is epoch time in perl?

982


Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.

1103


Does Perl have objects? If yes, then does it force you to use objects? If no, then why?

1024


How to know whether a key exists or not in perl?

1020


Mention what is cpan?

1079


Differentiate use and require?

1000


What are the reasons that cookie server can’t handle multiple connections?

990