×

Top 30 Perl interview questions for 2024

1) What is Perl?

It is a programming language which is used for web development, system administration, GUI development and etc. It is also known as cross-platform programming language.

2) What are the Features of Perl?

The features of Perl are:
  • Simple object oriented programming syntax
  • Easily extendible
  • Open source modules
  • Supports third party databases
  • Cross platform language
  • Embeddable in other systems

3) What are the types of data types used in Perl?

The types of data types used in Perl are:
  • Scalars
  • Arrays
  • Hashes

4) What are the types of "Perl Operators"?

The types of Perl operators are:
  • String operators
  • Bitwise operators
  • Assignment operators
  • Numeric operators
  • Special operators
  • Comparison operators
  • Logical operators

5) What are types of Perl variables?

The variables used in Perl are:
  • Scalars
  • Arrays
  • Hashes

6) How many loop control keywords are there in Perl?

The loop control keywords in Perl are:
  • Redo
  • Next
  • Last

7) What are array functions in Perl?

It is used to add or remove some elements in an array. Four types of Perl array functions are:
  • Shift
  • Unshift
  • Push
  • Pop

8) Write a simple program in Perl to print "PERL EXPERT"?

Example
print "PERL EXPERT \n";

9) What will be the output of the following code snippet?

for ($count = 10; $count >= 1; $count--)  

 {  

 print "$count ";  

 }
OUTPUT: 10 9 8 7 6 5 4 3 2 1

10) Write a program in Perl to check the number is Even or Odd?

Example:
print "Enter a Number:\n";    

$num = <>;    

if( $num %2==0 ){    

printf "Even Number\n";    

}else{     

printf "Odd Number\n";    

}

11) What will be the output of the following code snippet?

use strict;  

use warnings;  

my $x = "Jaiswal";  

$y::x = "Atul";  

print "$y::x\n";  

print "$x\n";
OUTPUT: Atul Jaiswal

12) What is the use of the –w switch in Perl?

It is used to produce extra warning messages in Perl.

13) What are the types of Scalar functions used in Perl?

The types of Scalar Functions used in Perl are:
  • Defined
  • Undef
  • Ref
  • Reverse
  • Chomp
  • Chop
  • Index
  • Return

14) What are the types of Hash functions used in Perl?

The types of Hash Functions used in Perl are:
  • Exists
  • Delete
  • Sort
  • Values
  • Keys
  • Each
  • Hash length
  • Context

15) What will be the output of the following code snippet?

$a = 5;    

while($a < 150)  

{    

if( $a == 40 )  

{    

$a = $a + 10;    

redo;    

}    

print "a = $a\n";    

}  

continue  

{    

$a = $a * 2;    

}
OUTPUT:
a = 5
a = 10
a = 20
a = 50
a = 100

16) Who is the developer of Perl programming language?

Larry Wall is the developer of Perl programming language.

17) What is the file extension of Perl programming language?

.pl or .PL is the file extension of Perl programming language.

18) What are Hashes in Perl?

Hashes: They are unordered set of key and value pairs that you access using the keys as subscripts. Hashes are denoted by a percent (%) sign.

19) What is the use of sort() function in Perl?

sort() function: This function is used to sorts each element of an array according to the ASCII Numeric standards.

20) What is the full form of GMT?

GMT stands for Greenwich Mean Time.

21) What is the use of localtime() in Perl?

localtime(): It is a function which returns values for the current date and time if given no arguments.

22) What is the difference between gmtime() and localtime() functions?

gmtime() function: This function works similar to the localtime() function. gmtime() function return the universal Greenwich Mean Time (GMT). localtime() function: This function return the current local time on the machine.

23) What is Dereferencing in Perl?

Dereferencing: It returns the value from a reference point to the location. To dereference a reference, you can use $, @ or % as prefix of the reference variable.

24) Which feature of Perl provides code reusability?

Inheritance feature of Perl provides code reusability.

25) Can we load binary extension dynamically in Perl?

Yes, we can load binary extension dynamically in Perl.

26) What is the syntax to add two arrays together in Perl?

The syntax to add two arrays together in Perl is:
@arrayvar = (@array1,@array2);

27) What is the syntax of grep function in Perl?

The syntax of grep function in Perl is:
  1. grep BLOCK LIST
  2.  grep (EXPR, LIST)

28) Why Perl aliases are considered to be faster than references?

Perl aliases are faster than references because they do not require any dereferencing.

29) What are the prefix dereference available in Perl?

The prefix dereference available in Perl are:
@: denotes arrays

&: denotes subroutine

%: denotes Hash variables

$: denotes Scalar variables

30) Which keyword is used to call a subroutine?

&myvariable is used to call a subroutine.

Related Topics

Top 28 Scala Interview Questions for 2024

1) What is Scala? Scala is a functional and object-oriented programming language. It is used to develop web application, mobile application, enterprise application, desktop based application etc. Everything in Scala is in object...

4 minutes read.

Top 15 NodeJS Interview Questions for 2024

1) What is NodeJs? NodeJs is open source JavaScript based feamework used to develop I/O intensive web application. It is collections of JavaScript library and runtime environment. It is used to...

3 minutes read.

Top 30 Zend Framework Interview Questions for 2024

1) What is Zend Framework? Zend is an open source, object-oriented web application framework. It is implemented in PHP 5. It was developed in 3 March 2006. 2) What is the use...

6 minutes read.

Top 15 ES6 Interview Questions for 2024

Commonly Asked ES6 Interview Questions and Answers 1) What is ES6? ES6 is a scripting language specification standardized. It is used to enable client-side scripting. The specification is influenced by programming languages (Self, Python, Perl,...

2 minutes read.

Top 14 Apache Presto Interview Questions for 2024

1) What is Presto? Presto is a distributed SQL query engine. It is an open source software project to develop a database. 2) What are the features of Presto? There are following features...

2 minutes read.

Artificial Neural Network Interview Questions

1. Explain Neural Network?  Neural Network is a sequence of an algorithm that gives its best to recognize the underlying relationship in a data-set through a process. The artificial neural network...

8 minutes read.

Top 28 Prototype Interview Questions for 2024

1) What is Prototype? Prototype is a JavaScript framework which is used in dynamic web applications. It is a namespace and a module that is used to manage HTML forms. It is also...

4 minutes read.

PhoneGap Interview Questions 2024

Top 50 Phonegap Interview Questions with their Answers Once you have acquired practical knowledge of the PhoneGap technology, you will now be able to search for a job as a mobile...

9 minutes read.

Top 15 Framework7 Interview Questions for 2024

1) What is Framework7? Framework7 is an open source mobile HTML framework. It is used todevelop hybrid mobile apps for iOS and Android devices. 2) Why, framework7 is popular? There are various reasons...

8 minutes read.

Top 25 DB2 Interview question for 2024

1) Give breif detail about DB2? DB2 is a Relational Database Management System developed by IBM. It supports Object Oriented features and non-relational structures with XML. 2) Enlist the types of datatypes...

3 minutes read.

Top 15 JavaFX Interview Questions for 2024

1) What is JavaFX? JavaFX is a software platform for creating desktop applications or internet application. It uses java library. It can run various devices such as Desktop Computer, Mobile, TVs...

3 minutes read.

Top 30 SQL Interview Questions for 2024

1. What is SQL? Ans. SQL stands for Structured Query Language.  It is a standard computer language for accessing, storing, and manipulating data stored in the relational database. SQL become an International Standard Organization (ISO)...

11 minutes read.

Top 20 Java Programming Coding Interview Questions for 2024

Coding is an integral part of any programming language. It is the most important phase of an interview. Interviewee checks the capability of thinking of any particular. I think one...

13 minutes read.

Polymer.js Interview Questions

1) What is Polymer.js? Polymer.js is an open source JavaScript library. It is developed by Google. It is used to develop web applications for using of web components like HTML. 2) Describe...

3 minutes read.

Top 43 React Native Interview Questions for 2024

1. What is React Native? React native is an open-source JavaScript framework designed by Facebook for native mobile applications development. It is based on a JavaScript library-React. React Native saves your development...

11 minutes read.

Top 15 ExpressJS Interview Questions for 2024

1) What is ExpressJs? Express Js is a framework for node.js which is light-weight and fast. It is used to develop web and mobile applications. 2) What are the features of ExpressJs? Following...

4 minutes read.

Top 30 Cobol Interview Questions for 2024

1) What is COBOL? COBOL is a programming language which is used for finance, business and administrative systems for companies. COBOL is stands for Common Business Oriented Language. 2) What are the features...

4 minutes read.

Top 30 CodeIgniter interview Questions for 2024

1) What is CodeIgniter? CodeIgniter is an open source PHP framework. It is used to develop web applications and websites. It is loosely based on MVC pattern and easy to use...

4 minutes read.

Top 30 Core Java Interview Questions for 2024

1. What is the difference between HashMap and Hashtable in Java? Ans. S.No. HashMap Hashtable 1. ...

6 minutes read.

Top 15 KnockoutJS Interview Questions for 2024

1) What is KnockoutJS? It is a JavaScript library which is based on MVVM pattern that helps developers in building rich and responsive websites. 2) Who is the author of KnockoutJS? Steve Sanderson is...

2 minutes read.