×

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 WordPress Interview Questions for 2024

Most Frequently asked WordPress Interview Questions and Answers 2019 1) What is WordPress? WordPress is an open-source CMS (Content Management System) and a blogging tool. It is used to create web sites and...

5 minutes read.

Top 10 Java Swing Interview Questions for 2024

1) What is Java Swing? It is a part of JFC (Java Foundation Classess) that is used to create window-based applications. Java Swing components are platform independent and lightweight . 2) What is...

3 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 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 15 Euphoria Interview Questions for 2024

1) What is Euphoria? Euphoria is a programming language. It is open source, powerful and easy to learn. It stands for End-User Programming with Hierarchical Objects for Robust Interpreted Applications 2) Who...

2 minutes read.

Top 10 GWT Interview Questions for 2024

1) What is Google Web Toolkit (GWT)? GWT (Google Web Toolkit) is a development toolkit. It is used to develop Ajax web applications using Java. GWT compiler translates Java sour ce...

2 minutes read.

Top 15 Pure CSS Interview Questions for 2024

1) What is Pure CSS? Pure is a CSS (Cascading Style Sheet) framework. It is a collection of small set of responsive CSS modules. We can integrate it to any web...

5 minutes read.

Top 20 HTTP Interview Questions for 2024

1) What is HTTP? HTTP stands for Hypertext Transfer Protocol. It is a set of rules for transferring of data on WWW (World Wide Web). 2) What are the basic Features of...

4 minutes read.

Top 30 Drupal Interview Questions for 2024

1) What is Drupal? Drupal is an open source CMS (Content Management System) framework. It is written in php and provides rich set of tools to create web sites. 2) What are...

4 minutes read.

Top 30 Joomla Interview Questions for 2024

1) What is Joomla? Joomla is an open source content management system. It is used to build online applications and websites. It uses model-view-controller (MVC) web application framework. It is free and easy to...

4 minutes read.

Top 28 Firebase Interview Questions for 2024

1) What is Firebase? Firebase is a platform which is used for building Web, IOS and Android applications. It offers: Real time database Different APIs Multiple authentication types and Hosting platform 2) What are the features of...

3 minutes read.

Top 15 Highcharts Interview Questions for 2024

1) What is Highcharts? Highcharts is a JavaScript based charting library. It is used to enhance web applications by adding interactive charting capability. Highcharts supports a wide range of charts. Charts are drawn using...

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

1) What is Xamarin? Xamarin is a .NET framework. It allows to create an application that run on multiple platforms. Xamarin Tutorial uses C# language and .NET framework to deliver native...

2 minutes read.

Top 15 CSS Buttons Interview Questions for 2024

1) What is CSS buttons? CSS buttons is used to create awesome button. It provides huge collection of CSS library files. 2) What are the CSS libraries to create buttons? There are following...

5 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.

Top 15 Java OOPS Interview Questions for 2024

1) What are the advantages of Java Package? Advantages of Java package are: Provides access protection Removes naming collision Easily maintained 2) What are the types of Access Modifiers in Java? Two types...

4 minutes read.

Top 30 SASS Interview Questions for 2024

1) What is Sass? SASS: Systematically Awesome Style Sheets is an extension of CSS. It is also known as CSS pre-processor which helps to reduce repetition with CSS and saves time. It is...

4 minutes read.

Top 25 Android Interview Questions for 2024

1) What is Android? It is a software package and open-source operating system that is used in mobile devices. It is also a Linux kernel-based system operating system and application executes within...

3 minutes read.

Top 30 AngularJS Interview Questions and Answers for 2024

Most Frequently asked AngularJS Interview Questions and Answers for Fresher 1) Describe Angular JS ? It is a powerful framework of JavaScript. AngularJS is used to design Rich Internet Application. This framework...

5 minutes read.