- 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 special variable represents current package name?
Answer : A
Explanation
_PACKAGE_ -represents current package name.
Q 3 - Which of the following method joins the separate strings of LIST into a single string with fields separated by the value of EXPR, and returns the string?
Answer : C
Explanation
join EXPR, LIST − This function joins the separate strings of LIST into a single string with fields separated by the value of EXPR, and returns the string.
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 checks if the value of two operands are equal or not, if yes then condition becomes true?
Answer : A
Explanation
== − Checks if the value of two operands are equal or not, if yes then condition becomes true.
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 returns true if the left argument is stringwise not equal to the right argument?
Answer : B
Explanation
ne − Returns true if the left argument is stringwise not equal to the right argument.
Q 8 - Which of the following function returns the universal Greenwich Mean Time, or GMT (or UTC)?
Answer : B
Explanation
gmtime − returns the universal Greenwich Mean Time, or GMT (or UTC).
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 function points current position of a pointer to a particular position in a file?
Answer : C
Explanation
You can use seek function to point a particular position inside the file.