- 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.
Answer : A
Explanation
Perl is a case sensitive programming language. Thus $Manpower and $manpower are two different identifiers in Perl.
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 $[ 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 - How will you get the size of a Hash?
Answer : A
Explanation
You can get the size − that is, the number of elements from a hash by using the scalar context on either keys or values.
Q 5 - Which of the following statement executes a sequence of statements multiple times and abbreviates the code that manages the loop variable?
Answer : C
Explanation
for loop − Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable.
Q 6 - Which of the following operator returns true if the left argument is stringwise greater than or equal to the right argument?
Answer : D
Explanation
ge − Returns true if the left argument is stringwise greater than or equal to the right argument.
Answer : D
Explanation
++ − Auto Increment operator increases integer value by one.
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 function opens a file in writing mode without truncating the file?
Answer : C
Explanation
open(DATA, "+<file.txt"); − opens a file in writing mode without truncating the file.
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