# Perl

> A script language known for finding and changing text fast.

**Field:** Software Development  
**Category:** Languages  
**Also known as:** Perl Language, Perl Script, Perl 5

## Think of it like

It is like a pocket knife for text. It can cut, find and swap words in any file.

## Definition

Perl is a scripting language known for working with text. It has regular expressions built right into the language. That makes it quick to search, change and report on log files and data. It was a main language of early websites. Today it is mostly found in older systems and in quick one-line jobs.

## Example

An admin uses one line of Perl to find errors. It prints each line of a log that says error.

## Example code

```console
$ perl -ne 'print if /error/' app.log
```

Read the log line by line and print the lines that say error.

## Why it matters

Lots of old servers and tools still run Perl. Its one-liners still solve text jobs in seconds.

## Common mistake

Writing clever code nobody can read later. Perl lets you pack a lot into one line, so leave room for others.

## Three principles

- **Text first.** Made for searching text.
- **Regex built in.** Patterns are part of the language.
- **One-liners.** Small jobs from the prompt.

## Related terms

- [Regular Expression (Regex)](https://learn.benibix.com/term/development/regular-expression)
- [Scripting Language](https://learn.benibix.com/term/development/scripting-language)
- [Shell Script](https://learn.benibix.com/term/development/shell-script)
- [Python](https://learn.benibix.com/term/development/python)

## Taught in

- [Shell Scripts, Perl and Lua](https://learn.benibix.com/learn/development-languages/shell-scripts-perl-and-lua): Programming Languages, 12/12

![Four labelled shelves of languages. Data science: R, MATLAB and Julia, beside a small bar chart. Functional: Haskell, Scala, Elixir, beside an arrow that turns a list into a new list. Shell and scripting: shell script, PowerShell, Perl and Lua, beside a terminal prompt. Close to the hardware: assembly language and Objective-C, beside a chip and a phone.](https://learn.benibix.com/diagrams/dev4-language-families.svg)

---

Source: https://learn.benibix.com/term/development/perl
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
