- 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.
Answer : A
Explanation
Perl is a case sensitive programming language. Thus $Manpower and $manpower are two different identifiers in Perl.
Q 2 - Which of the following special variable represents current package name?
Answer : A
Explanation
_PACKAGE_ -represents current package name.
Q 3 - Which of the following is correct about $[ Special Variable?
A - This special variable is a scalar containing the first index of all arrays.
B - Because Perl arrays have zero-based indexing, $[ will almost always be 0.
Answer : D
Explanation
All of the above options are correct.
Q 4 - Which of the following function returns all keys of a Hash?
Answer : A
Explanation
keys − You can get a list of all of the keys from a hash by using keys function.
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 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 returns -1, 0, or 1 depending on whether the left argument is stringwise less than, equal to, or greater than the right argument?
Answer : C
Explanation
cmp − Returns -1, 0, or 1 depending on whether the left argument is stringwise less than, equal to, or greater than the right argument.
Q 8 - Which of the following function returns the current local time on the machine that runs the script?
Answer : A
Explanation
localtime − returns the current local time on the machine that runs the script.
Q 9 - Which of the following is true about state variables?
B - These variables are defined using the state operator and available starting from Perl 5.9.4.
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;