Perl Interview Questions

Check out 30 of the most common Perl interview questions and take an AI-powered practice interview

System AdministrationWeb DevelopmentBioinformaticsText ProcessingCGI
30+
Questions
12
Basic
13
Intermediate
5
Advanced
Q1

What are the three fundamental data types in Perl?

BasicFundamentals
+
Q2

What is context in Perl and why does it matter?

BasicContext
+
Q3

What does `use strict; use warnings;` do and why should you always use them?

BasicBest Practices
+
Q4

How do you read a file line by line in Perl?

BasicFile I/O
+
Q5

What is `$_` (the default variable) and where does it appear?

BasicDefaults
+
Q6

How do you do basic regex matching and substitution in Perl?

BasicRegex
+
Q7

What is the difference between `my`, `our`, and `local`?

BasicScoping
+
Q8

How do you define and call a subroutine with arguments?

BasicSubroutines
+
Q9

How do you check if a key exists in a hash?

BasicHashes
+
Q10

What is CPAN and how do you install modules?

BasicModules
+
Q11

How do you join and split strings in Perl?

BasicStrings
+
Q12

What is interpolation in Perl strings?

BasicStrings
+
Q13

What are references in Perl and how do you use them?

IntermediateReferences
+
Q14

How does Perl handle OOP? Compare classic Perl OOP, Moose, and Moo.

IntermediateOOP
+
Q15

What's the difference between `=~` and `!~`?

IntermediateRegex
+
Q16

What are regex modifiers and when do you use them?

IntermediateRegex
+
Q17

How do you connect Perl to a database with DBI?

IntermediateDatabase
+
Q18

What's the difference between `map`, `grep`, and `for` in Perl?

IntermediateList Operations
+
Q19

What is a closure in Perl?

IntermediateSubroutines
+
Q20

How do you write a Perl one-liner to process a log file?

IntermediateOne-liners
+
Q21

What is the autovivification problem in Perl?

IntermediateReferences
+
Q22

How does Perl handle exceptions?

IntermediateError Handling
+
Q23

What is the difference between `wantarray`, scalar, and void context inside a subroutine?

IntermediateContext
+
Q24

What are slices in Perl?

IntermediateData Structures
+
Q25

How do you debug Perl code in production? Data::Dumper, Carp, and the debugger.

IntermediateDebugging
+
Q26

How do you write a CPAN-quality Perl module in 2026?

AdvancedModules
+
Q27

How do you profile and optimize slow Perl code?

AdvancedPerformance
+
Q28

How do you build a modern web app in Perl? (Mojolicious vs Catalyst vs Dancer)

AdvancedWeb Frameworks
+
Q29

How do you handle concurrency in Perl? Threads vs forks vs async (IO::Async/Mojo::IOLoop)?

AdvancedConcurrency
+
Q30

How do you call Perl from other languages or call C from Perl?

AdvancedInterop
+

Companies Hiring Perl

Booking.com
IBM
Cisco
Indian banking legacy systems
Wipro
TCS BPO
Telecom

Salary Insights

Average in India
₹5-15 LPA

Frequently Asked Questions

Is Perl dead in 2026?

No, but it's not growing either. Perl is in the 'COBOL phase' of its life cycle — enormous installed base that nobody's rewriting, low new-project adoption, stable jobs maintaining legacy. Booking.com, Bugzilla, Request Tracker, cPanel, and most Indian banking/telecom legacy backends still run Perl. The honest summary: don't pick Perl for a greenfield project in 2026 unless you have a specific reason (regex-heavy text processing, existing Perl team, integrating with a Perl-heavy environment). But Perl knowledge remains valuable — there's still good money in maintaining the systems that already exist.

How much does a Perl developer earn in India?

₹5-15 LPA in 2026, with the floor higher than Python equivalents because the pool of capable Perl developers has shrunk. Senior Perl + DBA + Linux admin combinations at Indian banks, telecom (Airtel, Jio backend bits), and BPO operations (Wipro, TCS, Infosys legacy contracts) can go ₹12-18 LPA. Booking.com's Bangalore office historically paid significantly above market for Perl talent. Specialised areas (bioinformatics, Perl on Wall Street back-office systems) pay at the upper end.

Should I learn Perl in 2026?

If you're starting your career, learn Python or JavaScript first — that's where the jobs are. Learn Perl as a second or third language if you (a) need it for a specific job, (b) work in bioinformatics or system administration, or (c) want to be able to read and maintain legacy systems. Perl 5.36+ is genuinely pleasant to write and the regex / one-liner skills transfer to every other language you'll ever use.

When does Perl still beat Python in 2026?

Three real cases. (1) One-liners and short text-processing scripts — `perl -lane '...'` is shorter and faster than the Python equivalent. (2) Heavy regex work — Perl's regex engine is the reference implementation and has features (recursive patterns, regex variables) Python's `re` module doesn't have natively. (3) Environments where Perl is pre-installed and you can't add new dependencies — most Linux distros, most Unix servers, many embedded systems. For everything else (web apps, ML, data science, modern CLI tools), Python has the better ecosystem in 2026.

What's the difference between Perl 5 and Perl 6/Raku?

Raku (renamed from Perl 6 in 2019) is a separate language that started as a Perl 5 successor but diverged significantly. They share aesthetics but not code — Raku is its own language with its own community and toolchain. When someone says 'Perl' in 2026 they mean Perl 5.36+, full stop. Raku has its own niche but isn't on the typical Indian enterprise stack.

Introduction

Perl is the language people love to declare dead and then keep using. In 2026 it still powers an enormous amount of production infrastructure: Booking.com's main application, Bugzilla, Request Tracker, cPanel, large slabs of legacy enterprise web, and the glue layer of countless DevOps pipelines. Indian banking back-offices, telecom OSS/BSS at Airtel and Jio, and BPO shops at Wipro/TCS still run substantial Perl codebases that nobody is in a hurry to rewrite.

Interviews for Perl roles in India in 2026 split into two camps. The 'maintain legacy systems' camp tests your ability to read 20-year-old code: contexts, references, $_, regex modifiers, symbol tables. The 'modern Perl' camp (Booking.com, smaller dev shops) tests Perl 5.36/5.38 features: native signatures, postfix dereferencing, Moose/Moo OOP, strictures, and CPAN literacy.

This guide covers the 30 most-asked Perl interview questions in 2026, grouped by difficulty. Each answer covers the underlying concept, common gotchas (and Perl has many), and a code example where it pays for itself. Honest note throughout: Python has eaten most of Perl's lunch for new projects, but Perl still wins for one-liners, hardcore regex, and any environment where 'Perl is already installed and works' beats 'install a new toolchain'.