- 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 an "at" sign (@) in Perl?
Answer : B
Explanation
Arrays are preceded by an "at" sign (@).
Q 2 - Which of the following variable context doesn't care what the return value is?
Answer : D
Explanation
Void − This context not only doesn't care what the return value is, it doesn't even want a return value.
Q 3 - Which of the following method splits a string into an array of strings, and returns it?
A - splice @ARRAY, OFFSET [ , LENGTH [ , LIST ] ]
B - split @ARRAY, OFFSET [ , LENGTH [ , LIST ] ]
Answer : B
Explanation
split [ PATTERN [ , EXPR [ , LIMIT ] ] ] - This function splits a string into an array of strings, and returns it. If LIMIT is specified, splits into at most that number of fields. If PATTERN is omitted, splits on whitespace.
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 checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true?
Answer : B
Explanation
>= − Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true.
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 epoch time?
Answer : C
Explanation
time − returns epoch time, i.e. the numbers of seconds that have elapsed since a given date, in Unix is January 1, 1970.
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 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.
To Continue Learning Please Login
Login with Google