×

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 30 FuelPHP Framework Interview Questions for 2024

1) What is FuelPHPFramework? FuelPHP Framework is an open source web application and written in PHP scripting language. It is based on the HMVC (Hierarchical Model View Controller) design pattern. It was released...

6 minutes read.

Top 15 Haskell Interview Questions for 2024

1) What is Haskell? Haskell is a functional programming language. It is based on mathematical functions. This programming language is more intelligent than other popular programming languages. 2) Who is the developer of...

2 minutes read.

Top 25 jQuery Interview Questions for 2024

Most Frequently asked jQuery Interview Questions and Answers for Fresher and Experienced 1) Define Find and Children Method? In DOM tree if you have to find all the method we use Find...

4 minutes read.

Top 30 Aurelia Interview Questions and Answers

1) What is Aurelia? Aurelia is an open source UI framework which is used for web and mobile app development. This framework is focused on web standards and follows simple conventions. 2) What...

2 minutes read.

Top 15 Meteor Interview Questions for 2024

1) What is Meteor or MeteorJS? Meteor is a JavaScript platform used for developing web and mobile applications. Applications develop using Meteor framework supports different platforms (like windows, android, ios). Meteor...

4 minutes read.

Top 30 TurboGears Framework Interview Questions for 2024

1) What is TurboGears Framework? TurboGears is a Python Framework. It is used to create rapid web application. It consists of several WSGI (Web Server Gateway Interface) components. It is developed...

5 minutes read.

Top 15 Foundation Interview Questions for 2024

1) What is Foundation? Foundation is a front-end framework that is for designing beautiful responsive websites. This framework is compatible with all types of devices and provides you with HTML, CSS...

2 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 15 SVG Interview Questions for 2024

1) What is SVG? SVG stands for Scalable Vector Graphics, It is XML based format used to draw dimentional vector images. It is a W3C standard. SVG supports all image formats. 2) What are...

2 minutes read.

Top 25 MySQL Interview Questions for 2024

1) What is MySQL? MySql is defined as multi-user DBMS which is built and distributed my MySQLab now acquired by Oracle Co. 2) Enlist the features of MySQL. Cross-Platform Support Wide range...

3 minutes read.

Top 15 JSP Interview Questions for 2024

1) What is JSP? It is a technology which is used to create web application like Servlet technology. It provides more functionality than Servlet. It consists of HTML and JSP tags. 2) What are...

3 minutes read.

Top 25 MongoDB interview Questions for 2024

1) Give some history about MongoDB. MongoDB came into existence when data increased exponentially on the internet. Thus, maintainence of database became very difficult in structured DB. MongoDB is a NoSQL...

3 minutes read.

Top 26 CouchDB interview questions for 2024

1) What is CouchDB? CouchDB is a document typed database server which can be accessed through RESTful JSON API. It is a schema free and Ad-hoc database with a flat address...

4 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 15 PhantomJS Interview Question for 2024

1) What is PhantomJS? PhantomJS is a lightweight headless scripted browser built on WebKit. It is used for automation web page interaction. 2) Why it is called as headless browser? PhantomJS called as...

4 minutes read.

Top 30 Ruby on Rails Interview Questions for 2024

1) What is Ruby on Rails? It is a server-side web application framework. It is an open source ruby framework which is used for developing database-backed web applications. Here, no compilation phase is...

4 minutes read.

Top 31 PHP Interview Questions for 2024

1) What is PHP? PHP is a object-oriented scripting language, open source, interpreted and executed at server side. It is also used to develop web applications. 2) What are the features of PHP? Features...

4 minutes read.

Top 32 Laravel Interview Questions for 2024

1) What is Laravel? Laravel is an open source PHP framework. It is used to design and develop web applications. It is based on MVC (Model-View-Controller) design pattern. It is created by Taylor...

6 minutes read.

Top 15 AWS Interview Questions for 2024

1) What is AWS? AWS stands for Amazon Web Services. It is a cloud web hosting platform that offers flexible, scalable, reliable, easy-to-use, and cost-effective solutions. 2) What is Cloud Computing? It is...

2 minutes read.

Top 15 Java Multithreading Interview Questions for 2024

1) What is Multithreading in Java ? It is a process of executing multiple threads simultaneously. It is used to achieve multitasking. It is mostly used in animation and games etc. 2) What are...

4 minutes read.