Explanation: There is no boolean type in Perl.
Dear candidates you will find MCQ questions of Perl here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
Explanation: There is no boolean type in Perl.
$m = 2;
if ($m){
print "True";
}
else{
print "False";
}
Explanation: All value greater than 0 are true in Perl.
Explanation: Types of operators:
Arithmetic Operator
Relation Operator
Logical Operator
Bitwise Operator
Assignment Operator
Ternary Operator
Explanation: Logical operators in Perl are used to combine multiple conditions.
100 << 3
Explanation: The "<<" is a binary left shift operator, if left shifts the bits of the first operand, the second operand decides the number of places to shift.
Explanation:
= is simple assignment operator
+= is addition assignment operator
%= is remainder assignment operator
$val1 = 5; $val2 = 10; $result = $val1 == $val2 ? $val1 : $val2; print "$result"
Explanation: The "x" operator in Perl strings is used to repeat the given string multiple times.
Explanation: In Perl, auto increment / decrement operator are used to increase or decrease values.