- 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 is correct about Perl?
A - Perl can handle encrypted Web data, including e-commerce transactions.
Answer : D
Explanation
All of the above options are correct.
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 - 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 statement jumps to the statement labeled with LABEL and resumes execution from there?
Answer : A
Explanation
goto LABEL − The goto LABEL form jumps to the statement labeled with LABEL and resumes execution from there.
Q 6 - Which of the following operator returns true if the left argument is stringwise equal to the right argument?
Answer : A
Explanation
eq − Returns true if the left argument is stringwise equal to the right argument.
Q 7 - Which of the following operator returns -1, 0, or 1 depending on whether the left argument is stringwise less than, equal to, or greater than the right argument?
Answer : C
Explanation
cmp − Returns -1, 0, or 1 depending on whether the left argument is stringwise less than, equal to, or greater than the right argument.
Q 8 - Parameters of a function can be acessed inside the function using the special array @_?
Answer : A
Explanation
Parameters can be acessed inside the function using the special array @_. Thus the first argument to the function is in $_[0], the second is in $_[1], and so on.
Q 9 - Which of the following is true about state variables?
B - These variables are defined using the state operator and available starting from Perl 5.9.4.
Answer : C
Explanation
Both of the above options are correct.
Q 10 - Which of the following function returns a single character from the specified FILEHANDLE, or STDIN if none is specified?
Answer : B
Explanation
The getc function returns a single character from the specified FILEHANDLE, or STDIN if none is specified.