Perl Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to Perl. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - Which of the following data type is suppported in Perl?

A - Scalar

B - Array

C - Hashes

D - All of the above.

Answer : D

Explanation

All of the above data types are supported in Perl.

Q 2 - In which of the following variable context, an expression is being evaluated to see whether it's true or false?

A - Scalar

B - List

C - Boolean

D - Void.

Answer : C

Explanation

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

Answer : A

Explanation

You can get the size − that is, the number of elements from a hash by using the scalar context on either keys or values.

Q 5 - Which of the following statement expects the expression to return a label name and then jumps to that labeled statement?

A - goto LABEL

B - goto EXPR

C - goto &NAME

D - None of the above.

Answer : B

Explanation

goto EXPR − The goto EXPR form is just a generalization of goto LABEL. It expects the expression to return a label name and then jumps to that labeled statement.

Q 6 - Which of the following operator returns true if the left argument is stringwise equal to the right argument?

A - eq

B - ne

C - cmp

D - ge

Answer : A

Explanation

eq − Returns true if the left argument is stringwise equal to the right argument.

Q 7 - Which of the following operator returns true if the left argument is stringwise not equal to the right argument?

A - eq

B - ne

C - cmp

D - ge

Answer : B

Explanation

ne − Returns true if the left argument is stringwise not equal to the right argument.

Answer : C

Explanation

The my operator confines a variable to a particular region of code in which it can be used and accessed. Outside that region, this variable cannot be used or accessed.

Q 10 - Which of the following function disassociate the filehandle from the corresponding file?

A - close

B - unlink

C - seek

D - None of the above.

Answer : A

Explanation

close − To close a filehandle, and therefore disassociate the filehandle from the corresponding file, you use the close function. This flushes the filehandle's buffers and closes the system's file descriptor.

perl_questions_answers.htm
Advertisements