- 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 - In which of the following variable context, an expression is being evaluated to see whether it's true or false?
Answer : C
Explanation
Boolean − Boolean context is simply any place where an expression is being evaluated to see whether it's true or false.
Q 3 - Which of the following is correct about Hashes?
A - A hash is a set of key/value pairs.
Answer : D
Explanation
All of the above options are correct.
Q 4 - Which of the following statement causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating?
Answer : A
Explanation
next statement − Causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.
Q 5 - Which of the following operator divides left hand operand by right hand operand and returns remainder?
Answer : C
Explanation
% − Modulus − Divides left hand operand by right hand operand and returns remainder.
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.
Answer : D
Explanation
++ − Auto Increment operator increases integer value by one.
Answer : A
Explanation
By default, all variables in Perl are global variables, which means they can be accessed from anywhere in the program.
Q 9 - Which of the following operator is used when the current value of a variable must be visible to called subroutines?
Answer : B
Explanation
The local is used when the current value of a variable must be visible to called subroutines.
Q 10 - Which of the following code create a reference for a hash?
Answer : C
Explanation
You can create a reference for any hash by prefixing it with a backslash as follows - $ref = \%ENV;