
Q1
Q1 What is Perl primarily used for?
Data visualization
Text processing and automation
Mobile app development
Game development
Q2
Q2 Which of the following is true about Perl?
It is compiled
It is interpreted
It cannot be used for web development
It does not support regular expressions
Q3
Q3 Which language heavily influenced Perl?
Java
Python
C
Ruby
Q4
Q4 Which extension is typically used for Perl script files?
.java
.perl
.pl
.script
Q5
Q5 What does TIMTOWTDI mean in Perl?
There is more than one way to do it
The interpreter must translate only well-defined inputs
Text indexing method for word tokenization
Temporary intermediate module to overwrite data interaction
Q6
Q6 What is the significance of CPAN in Perl?
A compiler for Perl code
A built-in debugging tool
A repository for Perl modules
A Perl syntax checker
Q7
Q7 Which of the following is NOT a feature of Perl?
Strong text-processing capabilities
Object-oriented support
Built-in garbage collection
Static typing
Q8
Q8 Which symbol is used to define an array in Perl?
@
$
%
&
Q9
Q9 A Perl script throws an error ‘Global symbol requires explicit package name’. What is the likely reason?
The variable is not declared properly
Perl version is outdated
The script contains syntax errors
The module used is not available
Q10
Q10 Which character is used to indicate a comment in Perl?
#
//
--
/* */
Q11
Q11 How do you declare a variable in Perl?
var name;
my $name;
let name;
declare name;
Q12
Q12 Which of the following is NOT a valid data type in Perl?
Scalar
Array
Tuple
Hash
Q13
Q13 What does a scalar variable in Perl store?
A single value
A list of values
Key-value pairs
A function reference
Q14
Q14 Which of the following is a valid variable name in Perl?
123var
$name_var
@user.name
var-name
Q15
Q15 What is the default value of an uninitialized scalar variable in Perl?
0
undef
NULL
empty string
Q16
Q16 How do you concatenate two strings in Perl?
Using + operator
Using . operator
Using & operator
Using , operator
Q17
Q17 Which of the following is true about Perl arrays?
Arrays in Perl have fixed sizes
Arrays can only store strings
Arrays can contain elements of different data types
Arrays are not supported in Perl
Q18
Q18 What will be the output of the following code?
my $var = "Hello"; print "$var World";
Hello World
$var World
Hello
Syntax Error
Q19
Q19 A Perl script throws an error ‘Global symbol requires explicit package name’. What is the most likely reason?
Using an undeclared variable
Incorrect function syntax
Division by zero
Using single quotes for strings
Q20
Q20 What is the correct way to declare a scalar variable in Perl?
$name = "John";
var name = "John";
scalar name = "John";
let $name = "John";
Q21
Q21 What does my do when declaring a variable in Perl?
Declares a global variable
Declares a variable with lexical scope
Creates a constant variable
Deletes a variable
Q22
Q22 What will be the output of my $x = 10; my $y = $x + 5; print $y;?
10
5
15
$y
Q23
Q23 Which of the following symbols represents a hash in Perl?
%
@
$
&
Q24
Q24 What is the purpose of the undef function in Perl?
Converts a variable to zero
Deletes a variable from memory
Assigns an undefined value to a variable
Concatenates strings
Q25
Q25 What happens when you use an uninitialized scalar variable in Perl?
Throws an error
Uses a default value of 0
Uses a default value of undef
Terminates the script
Q26
Q26 What will be the output of print 3 + "2 apples"; in Perl?
3
Error
5
2 apples
Q27
Q27 What is the output of my $x = 5; my $y = 10; print $x * $y;?
50
5
10
15
Q28
Q28 What does .= operator do in Perl?
Assigns a new value to a variable
Concatenates and assigns a string
Performs bitwise AND
Returns an undefined value
Q29
Q29 A Perl script throws the error "Use of uninitialized value". What is the likely cause?
Using a variable that is not assigned a value
Using a non-existent module
Using an incorrect loop structure
Dividing by zero
Q30
Q30 Why does the expression 10 / 0 cause an error in Perl?
Division by zero is undefined
Perl does not support division
Perl treats 0 as an object
10 is not a valid number