kids encyclopedia robot

Perl facts for kids

Kids Encyclopedia Facts
Quick facts for kids
Perl
Perl-logo.svg
Paradigm Multi-paradigm
Designed by Larry Wall
Developer Larry Wall
First appeared December 18, 1987; 37 years ago (1987-12-18)
Stable release
5.42.0 / 3 July 2025; 38 days ago (2025-07-03)
Preview release
5.43.1 / 20 July 2025; 21 days ago (2025-07-20)
Typing discipline Dynamic
Implementation language C
OS Cross-platform
License Artistic 1.0 or GNU General Public License version 1 or any later version
Filename extensions .plx, .pls, .pl, .pm, .xs, .t, .pod, .cgi, .psgi
Influenced by
AWK, BASIC, C, C++, Lisp, sed, Unix shell
Influenced
CoffeeScript, Groovy, JavaScript, Julia, LPC, PHP, Python, Raku, Ruby, PowerShell

Perl is a powerful programming language that helps computers do many different tasks. It was created by Larry Wall in 1987. He designed it to make it easier to process reports on Unix systems.

Perl is known for being very flexible and good at handling text. It can easily work with strings of words and patterns. Because of this, it became very popular in the mid-1990s for creating CGI scripts for websites.

Today, people use Perl for many things. This includes managing computer systems, programming networks, working with finances, and even in bioinformatics (using computers to study biology). It's sometimes called "the Swiss Army chainsaw of scripting languages" because it's so versatile.

What's in a Name?

The Camel symbol used by O'Reilly Media
The onion logo used by The Perl Foundation

Perl was first called "Pearl." Larry Wall wanted a short name that sounded positive. He also thought of the Parable of the Pearl from the Bible. But he found out there was already a language called PEARL. So, he removed the "a" and called it Perl.

Sometimes, people say Perl stands for "Practical Extraction and Report Language." Larry Wall also jokingly called it "Pathologically Eclectic Rubbish Lister."

The book Programming Perl has a picture of a camel on its cover. Because of this, the camel became an unofficial symbol for Perl. O'Reilly Media owns this camel image. They let people use it for free for non-commercial projects.

The Perl Foundation uses a different symbol: an onion. This is a fun play on words, like a "pearl onion." In 2024, a new camel logo was released. It is not official but represents the language and its community.

How Perl Grew Over Time

The Beginning of Perl

Larry Wall started working on Perl in 1987. He was a programmer at Unisys. He released the first version, Perl 1.0, on December 18, 1987. Early Perl versions were good at handling text, like other languages at the time.

Perl 2 came out in June 1988. It had a better way to find text patterns. Perl 3, released in October 1989, could work with binary data.

Perl in the 1990s

For a while, the only guide for Perl was a long man page. In 1991, a book called Programming Perl was published. Many programmers called it the "Camel Book" because of its cover. This book became the main guide for the language.

Perl 4 was released in March 1991. It was not a huge change to the language itself. The number 4 was used to show that this version was well-documented by the new book.

Larry Wall stopped working on Perl 4 in 1993 to start Perl 5. The perl5-porters mailing list began in May 1994. This group helped develop Perl 5 and make it work on different computers. It is still the main place for Perl 5 development.

Perl 5.000 was released on October 17, 1994. This was a big update. It added many new features like objects, references, and modules. Modules were very important. They let people add new features to Perl without changing the main program. This helped Perl grow a lot.

A very important event happened in Perl 5's history because of modules. On October 26, 1995, the Comprehensive Perl Archive Network (CPAN) was created. CPAN is a huge collection of Perl programs and modules. As of December 2022, it has over 211,850 modules. These modules were written by more than 14,324 people. CPAN is available all over the world.

Perl 5.004 came out in May 1997. It added support for Microsoft Windows and other operating systems. It also included the CGI.pm module. This module helped make Perl very popular for creating web pages.

Perl 5.005 was released in July 1998. It improved how Perl handled text patterns. It also added support for more operating systems like BeOS.

Perl in the 2000s and 2010s

Perl 5.6 was released in March 2000. It added support for 64-bit systems and Unicode text. Unicode allows Perl to work with many different languages and symbols.

In 2001, work started on "Apocalypses" for Perl 6. These documents were meant to guide the design of the next version of Perl. At this time, Perl 6 was just an idea.

Perl 5.8 was first released in July 2002. Newer 5.X versions have been released almost every year since then. Perl 5.8 improved Unicode support and added new features.

On December 18, 2007, Perl 5.10.0 was released. This was Perl 1.0's 20th birthday. Perl 5.10.0 added new features that were similar to ideas for Perl 6. These included a "given"/"when" switch statement and updates to text patterns.

Perl 5.12.0 was released in April 2010. It added new syntax and features like the "yada yada operator" for placeholder code. It also had full Y2038 compliance, meaning it could handle dates beyond 2038.

Perl 5.14 was released in May 2011 with JSON support built-in. Perl 5.16, released in May 2012, updated support for Unicode 6.1.

Perl 5.18 came out in May 2013. It improved security for how Perl handles data. It also supported Unicode 6.2.

Perl 5.20 was released in May 2014. It added new ways to define functions and handle data. It also supported Unicode 6.3.

Perl 6 and Raku

Camelia
Camelia, the logo for the Perl 6 project

In 2000, there was a big discussion about creating a new version of Perl. This led to the decision to redesign the language and call it Perl 6. People from the Perl community sent in many ideas for new features.

Larry Wall worked for years to combine these ideas into a plan for Perl 6. He shared his design in documents called "apocalypses." Later, these designs were put into "Synopses."

In 2001, it was decided that Perl 6 would run on a special virtual machine called Parrot. This machine was designed to work with many different programming languages.

In October 2019, Perl 6 was renamed to Raku. This change helped show that Raku is a separate language, even though it started from Perl. As of 2017, the main way to use Raku is with the Rakudo implementation and MoarVM.

Perl 7

In June 2020, Perl 7 was announced as the next version after Perl 5. The idea was for Perl 7 to be based on Perl 5.32. It was planned to be compatible with modern Perl 5 code.

However, this plan was changed in May 2021. There were concerns about how older Perl 5 programs would work with the new Perl 7. The Perl Steering Committee decided to wait. Perl 7 will only be released when enough new features are added to make it a truly major upgrade.

How Perl is Designed

Core Ideas

Larry Wall said Perl has two main ideas. The first is "There's more than one way to do it." This means you can often solve a problem in many different ways using Perl. This makes it easy to write short and clear code.

The second idea is "Easy things should be easy and hard things should be possible." This means Perl tries to make simple tasks very easy. For harder tasks, it gives you the tools to get them done.

Perl was designed to help programmers write programs faster and easier. Many older languages focused on making computers work efficiently. Perl, however, focuses on making the programmer's job easier.

Perl has many features that help programmers. These include automatic memory management and flexible data types like strings, lists, and hashes. Perl also uses regular expressions, which are powerful tools for finding and changing text patterns.

Larry Wall studied languages, and Perl's design shows this. It uses short words for common tasks. It also has many basic building blocks, like words in a language. Perl prefers code that is easy for humans to write, even if it makes the computer work a bit harder.

Key Features

Perl's basic structure is similar to the C programming language. It uses variables, expressions, and control structures like loops.

Perl also takes ideas from Unix shell programming. All variables in Perl start with special symbols called sigils. These sigils tell you what kind of data the variable holds. For example, `$` is for a single item, `@` is for a list, and `%` is for a hash (a list of key-value pairs).

Perl uses "hashes" (also called "associative arrays") from the AWK language. It also uses powerful text pattern matching from the sed tool. These features make it easy to handle text and manage data.

Perl 5 added features for object-oriented programming. This allows programmers to organize their code into reusable "objects." A big change in Perl 5 was the ability to create reusable "modules." Larry Wall said that the goal of modules was to help the Perl community grow.

All versions of Perl automatically manage data types and memory. The computer knows what kind of data each item is. It also handles storing and freeing up memory as needed.

How Perl Code Looks

Some people say Perl code can look like "line noise" or is hard to read. However, experienced Perl programmers often find it clear. The Perl documentation says that special variables "look like punctuation or line noise." But there are ways to make code easier to read, like using longer names for these variables.

Here is a simple Perl program that prints "Hello, World!":

print "Hello, World!\n";

Here is a more complex Perl program. It counts down seconds from a number you give it:

#!/usr/bin/env perl
use strict;
use warnings;

my ( $remaining, $total );

$remaining=$total=shift(@ARGV);

STDOUT->autoflush(1);

while ( $remaining ) {
    printf ( "Remaining %s/%s \r", $remaining--, $total );
    sleep 1;
}

print "\n";

To run this code, save it as `counter.pl`. Then, open your computer's command line and type:

$ perl counter.pl 42

You can also use Perl for quick tasks right from the command line. This example changes "Bob" to "Robert" in all text files in the current folder:

$ perl -i.bak -lp -e 's/Bob/Robert/g' *.txt

How Perl Works Inside

Perl does not have a formal written rulebook or standard. The language has grown along with its main program, called the interpreter. This interpreter, along with its tests, acts as the official guide for how Perl works.

The Perl interpreter is mostly written in the C programming language. It also uses many modules written in Perl and C. The interpreter takes your Perl code and turns it into a "syntax tree." This tree is like a map of your program. Then, the interpreter walks through this map to run your program.

Perl is tested very carefully. It comes with over 250,000 tests for the main language and its modules. These tests run when Perl is built. They help make sure that any changes to Perl do not cause new problems. If Perl passes these tests on your computer, you can be sure it is working correctly.

Where Perl Can Run

Perl can run on almost all operating systems. It is very common on Unix and Unix-like systems, like Linux. But it has also been made to work on many other modern and older computer systems.

The Comprehensive Perl Archive Network lists all the systems Perl supports. It also has links to where you can get Perl for each system. CPAN is also the place to find many extra Perl modules that are not part of the main Perl program.

ActivePerl is a version of Perl made by a company called ActiveState. It is updated regularly to match the main Perl releases.

How Fast is Perl?

Perl's speed can vary. It is an interpreted language, which means it reads and runs your code line by line. This is different from compiled languages like C, which turn all the code into a single program before running.

Large Perl programs can start slower than compiled programs. This is because Perl has to read and prepare the code each time it runs. However, for most programs, this startup time is not a big deal.

There are ways to make Perl programs run faster. For example, mod_perl helps speed up Perl programs used for websites. If a part of your Perl program needs to be super fast, you can write that part in another language like C. Then, you can connect it to your Perl code.

What Perl is Used For

Perl has many uses, especially because of all the modules available on CPAN.

Perl has been used a lot for CGI scripts on the web. Big websites and tools like cPanel, Bugzilla, RT, TWiki, and Movable Type were built with Perl. Popular websites like Priceline.com, Craigslist, IMDb, LiveJournal, DuckDuckGo, Slashdot and Ticketmaster use Perl a lot. It is also an option for the LAMP web development setup, instead of PHP or Python.

Perl is often used as a "glue language." This means it connects different computer systems or programs that were not designed to work together. It's also great for "data munging." This means taking large amounts of data and changing or processing it, like creating reports. These strengths make Perl popular for system administrators. They can use short Perl programs, sometimes called "one-liner programs," to do quick tasks.

Perl code can work on both Microsoft Windows and Unix systems. This helps software companies package and maintain their programs more easily.

You can also add graphical user interfaces (GUIs) to Perl programs using tools like Perl/Tk and wxPerl.

Perl's text-handling skills are useful for creating SQL queries for databases. The Perl DBI (Database Interface) module lets Perl programs talk to many different databases. This makes it easy to get and process large amounts of data.

The Perl Community

The community around Perl has grown with the language. Usenet was the first place where Perl was discussed publicly. As the internet grew, so did the Perl community. Larry Wall often talks about the Perl community in his yearly "State of the Onion" speeches.

These "State of the Onion" talks are famous for Larry Wall's humor. He talks about Perl culture, hacker culture, his background in languages, and sometimes his family or Christian faith. These talks are given at Perl conferences and then put online.

In emails and online forums, you might see "Just another Perl hacker" (JAPH) programs. These are short, clever Perl programs that print that exact phrase. They were started by Randal L. Schwartz, an early Perl teacher. Perl programmers are often called "Perl hackers."

"Perl golf" is a fun game where people try to write Perl programs using the fewest characters possible. It's like golf, where you try to use the fewest strokes. This game became popular when someone wrote a very short Perl program to do RSA encryption. Now, "code golf" is played in other languages too.

There were also "Obfuscated Perl Contests" from 1996 to 2000. These contests celebrated how flexible Perl's syntax is. People would write code that was intentionally hard to read but still worked.

Perl poetry is another creative activity. People write poems that are also valid Perl code. This is possible because Perl uses many English words in its language. New Perl poems are often shared on PerlMonks.

See also

Kids robot.svg In Spanish: Perl para niños

  • Outline of Perl
  • Perl Data Language
  • Perl Object Environment
  • Plain Old Documentation
kids search engine
Perl Facts for Kids. Kiddle Encyclopedia.