
- Perl - Home
- Perl - Introduction
- Perl - Environment
- Perl - Syntax Overview
- Perl - Data Types
- Perl - Variables
- Perl - Scalars
- Perl - Arrays
- Perl - Hashes
- Perl - IF...ELSE
- Perl - Loops
- Perl - Operators
- Perl - Date & Time
- Perl - Subroutines
- Perl - References
- Perl - Formats
- Perl - File I/O
- Perl - Directories
- Perl - Error Handling
- Perl - Special Variables
- Perl - Coding Standard
- Perl - Regular Expressions
- Perl - Sending Email
- Perl - Socket Programming
- Perl - Object Oriented
- Perl - Database Access
- Perl - CGI Programming
- Perl - Packages & Modules
- Perl - Process Management
- Perl - Embedded Documentation
- Perl - Functions References
- Perl Useful Resources
- Perl - Questions and Answers
- Perl - Quick Guide
- Perl - Cheatsheet
- Perl - Useful Resources
- Perl - Discussion
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.

Q 1 - Which of the following data types are preceded by a dollar sign ($) in Perl?
Answer : A
Explanation
Scalars are preceded by a dollar sign ($).
Q 2 - Which of the following is correct about Array in Perl?
A - An array is a variable that stores an ordered list of scalar values.
Answer : D
Explanation
All of the above options are correct.
Q 3 - Which of the following method remove the elements of @ARRAY designated by OFFSET and LENGTH, and replaces them with LIST, if specified?
A - splice @ARRAY, OFFSET [ , LENGTH [ , LIST ] ]
B - split @ARRAY, OFFSET [ , LENGTH [ , LIST ] ]
Answer : A
Explanation
splice @ARRAY, OFFSET [ , LENGTH [ , LIST ] ] - This function will remove the elements of @ARRAY designated by OFFSET and LENGTH, and replaces them with LIST, if specified. Finally, it returns the elements removed from the array.
Q 4 - How will you get the size of a Hash?
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 repeats a statement or group of statements until a given condition becomes true. It tests the condition before executing the loop body?
Answer : B
Explanation
until loop − Repeats a statement or group of statements until a given condition becomes true. It tests the condition before executing the loop body.
Q 6 - Which of the following operator checks if the value of two operands are equal or not, and returns -1, 0, or 1?
Answer : C
Explanation
<=> − Checks if the value of two operands are equal or not, and returns -1, 0, or 1 depending on whether the left argument is numerically less than, equal to, or greater than the right argument.
Q 7 - Which of the following operator encloses a string with-in double quotes?
Answer : B
Explanation
qq{ } − Encloses a string with-in double quotes.
Q 8 - Which of the following function formats date and time?
Answer : D
Explanation
strftime − formats date and time.
Q 9 - Which of the following function opens a file in writing mode without truncating the file?
Answer : C
Explanation
open(DATA, "+<file.txt"); − opens a file in writing mode without truncating the file.
Q 10 - Which of the following is true about dereferencing?
A - Dereferencing returns the value from a reference point to the location.
Answer : C
Explanation
Both of the above options are correct.