- Perl Basics
- 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 Advanced
- 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 - 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 - In which of the following variable context, assignment to an array or a hash evaluates the right-hand side in a list context?
Answer : B
Explanation
List − Assignment to an array or a hash evaluates the right-hand side in a list context.
Q 3 - Which of the following method prepends list to the front of the array, and returns the number of elements in the new array?
Answer : D
Explanation
unshift @ARRAY, LIST - Prepends list to the front of the array, and returns the number of elements in the new array.
Q 4 - Which of the following function returns all values of a Hash?
Answer : B
Explanation
values − You can get a list of all of the values from a hash by using keys function.
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.
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 is true about Subroutine Call Context?
Answer : C
Explanation
Both of the above options are correct.
Q 10 - Which of the following function disassociate the filehandle from the corresponding file?
Answer : A
Explanation
close − To close a filehandle, and therefore disassociate the filehandle from the corresponding file, you use the close function. This flushes the filehandle's buffers and closes the system's file descriptor.
To Continue Learning Please Login
Login with Google