Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What is boolean context in perl?

user-image
Question ajoutée par Sameer Ahmed Z , Project Assitant , Indian Institute of Science
Date de publication: 2016/06/06
Mohammad kasid
par Mohammad kasid , ICT Engineer (Sr. Database Administrator) , Ericsson Global India Ltd.

Boolean context is simply any place where an expression is being evaluated to see whether it's true or false.

sreenivasa murthy Raju
par sreenivasa murthy Raju , Technical Lead , Saudi Telecom Company

Perl does not have specific boolean type, but every scalar value when it checked using if condition will be either true or false.

for example:

if($variable eq "Hello")

{

   print "Value is True\\n";

}

The number 0, strings '0' and '', and "undef" are all false in a boolean context.

 

Boolean context holds true and false value.

There is three way we can identify the false statement

1.if the value is 0

2.if the value is " " i.e. null

3.if the value is undef

Except these three all the values are conidered as true.

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?