
- 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 correctly describes Hashes data types in Perl?
A - These are simple variables. They are preceded by a dollar sign ($).
B - These are ordered lists of scalars that you access with a numeric index which starts with 0.
C - These are unordered sets of key/value pairs that you access using the keys as subscripts.
Answer : C
Explanation
Hashes are unordered sets of key/value pairs that you access using the keys as subscripts. They are preceded by a percent sign (%).
Q 2 - Which of the following variable context doesn't care what the return value is?
Answer : D
Explanation
Void − This context not only doesn't care what the return value is, it doesn't even want a return value.
Q 3 - Which of the following method sorts the LIST and returns the sorted array value?
Answer : D
Explanation
sort [ SUBROUTINE ] LIST − This function sorts the LIST and returns the sorted array value. If SUBROUTINE is specified then specified logic inside the SUBTROUTINE is applied while sorting the elements.
Q 4 - How will you add a new key/value pair to a hash?
Answer : A
Explanation
Adding a new key/value pair can be done with one line of code using simple assignment operator.
Q 5 - Which of the following operator performs exponential (power) calculation on operators?
Answer : D
Explanation
** − Exponent − Performs exponential (power) calculation on operators.
Q 6 - Which of the following operator returns true if the left argument is stringwise less than or equal to the right argument?
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 encloses a string with-in double quotes?
Answer : B
Explanation
qq{ } − Encloses a string with-in double quotes.
Q 8 - Parameters of a function can be acessed inside the function using the special array @_?
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 is true about Subroutine Call Context?
Answer : C
Explanation
Both of the above options are correct.
Q 10 - Which of the following code create a reference for a array?
Answer : B
Explanation
You can create a reference for any array by prefixing it with a backslash as follows - $ref = \@ARGV;