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

Differentiate between c++ and perl.

944


What is the use of –w?

869


What are the steps involved in configuring a server using cgi programming?

848


Why is it hard to call this function: sub y { "because" } ?

875


What is use of ‘->’ symbol?

945


“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?

954


What does the’$_’ symbol mean?

947


How interpreter is used in perl?

881


What are the options that can be used to avoid logic errors in perl?

895


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

1002


What happens when you return a reference to a private variable?

937


What does 'do' statement do in perl?

912


What package you use to create a windows services?

830


What are the various uses of perl?

949


How do you give functions private variables that retain their values between calls?

894