Glossary term

Perl

PMore terms under P

Perl is a programming language used to process text, automate repetitive jobs and build programs, including programs used by websites. It is particularly known for finding and changing patterns in text.

A program written in Perl might clean up a list of records or read a website’s activity logs. Here, it turns the spaces between two words into a hyphen:

Perl · a small text transformation
my $label = "red    shoes";
$label =~ s/\s+/-/g;
print $label;  # red-shoes

The s/…/…/g expression is the interesting part: find matching text, replace it, and repeat through the string.

Early web developers also used Perl for CGI scripts: programs a website could run to process a form or build a page. CGI was the connection between the website-delivery software and the program; Perl was one language used to write the program.

Sources

← Browse Glossary: P