- 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 data types are preceded by a dollar sign ($) in Perl?
Answer : A
Explanation
Scalars are preceded by a dollar sign ($).
Q 2 - Which of the following variable context only happens inside quotes, or things that work like quotes?
Answer : A
Explanation
Interpolative − This context only happens inside quotes, or things that work like quotes.
Q 3 - Which of the following method shifts the first value of the array off and returns it, shortening the array by 1 and moving everything down?
Answer : C
Explanation
shift @ARRAY − Shifts the first value of the array off and returns it, shortening the array by 1 and moving everything down.
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 checks if the value of two operands are equal or not, if values are not equal then condition becomes true?
Answer : B
Explanation
!= − Checks if the value of two operands are equal or not, if values are not equal then condition becomes true.
Q 6 - Which of the following operator checks if the value of left operand is less than the value of right operand, if yes then condition becomes true?
Answer : A
Explanation
> − Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true.
Q 7 - Which of the following operator returns a list of values counting (up by ones) from the left value to the right value?
Answer : C
Explanation
.. − The range operator .. returns a list of values counting (up by ones) from the left value to the right value.
Q 8 - How will you get the count of parameters passed to a perl subroutine?
Answer : B
Explanation
using scalar(@_), we can get the total number of arguments passed.
Q 9 - Which of the following function deletes a file?
Answer : B
Explanation
unlink − used to delete a 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