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 2 - In which of the following variable context, assignment to an array or a hash evaluates the right-hand side in a list context?

A - Scalar

B - List

C - Boolean

D - Void.

Answer : B

Explanation

List − Assignment to an array or a hash evaluates the right-hand side in a list context.

Q 3 - Which of the following method pops off and returns the last value of the array?

A - push @ARRAY, LIST

B - pop @ARRAY

C - shift @ARRAY

D - unshift @ARRAY, LIST

Answer : B

Explanation

pop @ARRAY - Pops off and returns the last value of the array.

Q 4 - Which of the following statement restarts the loop block without evaluating the conditional again?

A - next

B - last

C - continue

D - redo

Answer : D

Explanation

redo statement − The redo command restarts the loop block without evaluating the conditional again. The continue block, if any, is not executed.

Q 5 - Which of the following statement substitutes a call to the named subroutine for the currently running subroutine?

A - goto LABEL

B - goto EXPR

C - goto &NAME

D - None of the above.

Answer : C

Explanation

goto &NAME − It substitutes a call to the named subroutine for the currently running subroutine.

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

A - lt

B - gt

C - le

D - ge

Answer : C

Explanation

le − Returns true if the left argument is stringwise less than or 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.

Q 8 - Parameters of a function can be acessed inside the function using the special array @_?

A - true

B - false

Answer : A

Explanation

Parameters can be acessed inside the function using the special array @_. Thus the first argument to the function is in $_[0], the second is in $_[1], and so on.

Q 9 - Which of the following function deletes a file?

A - delete

B - unlink

C - seek

D - None of the above.

Answer : B

Explanation

unlink − used to delete a file.

Q 10 - Which of the following function renames existing file?

A - rename

B - tell

C - seek

D - None of the above.

Answer : A

Explanation

Function rename takes two arguments and it just rename existing file.

perl_questions_answers.htm
Advertisements