ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What is boolean context in perl?

user-image
تم إضافة السؤال من قبل Sameer Ahmed Z , Project Assitant , Indian Institute of Science
تاريخ النشر: 2016/06/06
Mohammad kasid
من قبل 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
من قبل 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.

 

Rajiv Biswal
من قبل Rajiv Biswal

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.

المزيد من الأسئلة المماثلة