Logo F2FInterview

Perl Interview Questions

Q   |   QA

Values can be returned by a subroutine using an explicit return statement. Otherwise it would be the value of the last expression evaluated.

When we dereference a variable using particular prefix, they are called prefix dereference.

(i) $-Scalar variables
(ii) %-Hash variables
(iii) @-arrays
(iv) &-subroutines
(v) Type globs-*myvar stands for @myvar, %myvar.

The grep function evaluates an expr or a block for each element of the List. For each statement that returns true, it adds that element to the list of returning values.
Differentiate between C++ and Perl.

-C++ does not allow closures while Perl does
-C++ allows pointer arithmetic but Perl does not allow pointer arithmetic


A Chomp function removes the last character from an expr or each element of list if it matches the value of $/. This is considered to be safer than Chop as this removes only if there is a match.

A Chop function removes the last character from EXPR, each element of list.


CPAN is the Comprehensive Perl Archive Network, a large collection of Perl software and documentation. CPAN.pm is also a module in Perl which is used to download and install Perl software from the CPAN archive.


TK is an open source tool kit that is used to build web based applications using Perl. 

Perl handles two types of data they are
(i) Scalar Variables and
(ii) Lists
Scalar variables hold a single data item whereas lists hold multiple data items.

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: