openskills.info
Perl Fundamentals logoCourse Preview

Perl Fundamentals

Perl is a general-purpose programming language built for text processing, system administration, and gluing other programs and data formats together. It reads and rewrites files, drives command-line one-liners, and powers long-running scripts and web backends. It exists to make everyday data-wrangling and automation tasks quick to write, with regular expressions, file handling, and process control built into the core language rather than added by libraries.

itProgramming languages

Don't Panic - Perl Fundamentals

Perl is a programming language that Larry Wall built in 1987 to do the unglamorous work of computing: reading text, rewriting text, moving data between formats that were never meant to meet, and holding other programs together with string and tape. The corridor version is that Perl took the best parts of the Unix toolbox, awk, sed, the shell, a bit of C, and put them in one place so you did not have to wire six tools together to produce one report.

First, a naming hazard, because it trips everyone. When people say Perl, they mean Perl 5, currently version 5.44, developed continuously since 1994. There was a separate project called Perl 6 that began in 2000, grew into its own language, and was renamed Raku in 2019. A "Perl 7" was announced in 2020 and quietly set aside in 2021. So Perl means Perl 5, and if a tutorial talks about Perl 6, it is talking about a different language entirely.

Three ideas carry most of the language. The first is sigils: every variable starts with a punctuation mark that says what it is. $ for a single value, @ for a list, % for a set of key-value pairs. The second is context: every expression runs in either list or scalar context, decided entirely by what surrounds it, and the same array gives you its contents in one and its length in the other. The third is references, which are the only way to build a data structure with any depth, because plain Perl lists flatten themselves flat the moment you nest them.

The thing that will surprise you is that Perl mostly does not stop you when something goes wrong. open a file that is not there and Perl returns a quiet false and carries on; your reads just produce nothing. This is why almost every Perl program opens with use strict; and use warnings;, which turn a pile of silent mistakes into loud ones, and why experienced Perl checks the result of every open and system. The language you hear people complain about is the one written without those lines. The language that is genuinely pleasant to maintain is a subset you choose by opting in.

The other surprise is the size of the safety net around it. CPAN, the module archive that has been running since 1995, holds roughly 47,000 packages, which is the real reason Perl programs stay short: someone has already written and tested the JSON parser, the date handler, the database layer. You install from it with cpanm and pin versions with a cpanfile.

Where to go next. The Cheatsheet puts sigils, context, the regex operators, and the command-line switches on one page. Practice walks the perl, perldoc, cpanm, and prove commands with the reasoning for each. Field Notes is where people who maintain production Perl tell you what actually costs time. Timeline explains how a 1987 report-printing tool became the language it is now, which makes a lot of its quirks make sense.

Where this skill leads

Relevant careers

See how this topic contributes to broader role-level skill maps.

Sources

  • https://www.perl.org/
  • https://perldoc.perl.org/perlintro
  • https://perldoc.perl.org/perl
  • https://perldoc.perl.org/perlrun
  • https://perldoc.perl.org/perlreftut
  • https://perldoc.perl.org/perlref
  • https://perldoc.perl.org/perlre
  • https://perldoc.perl.org/perlretut
  • https://perldoc.perl.org/perlootut
  • https://perldoc.perl.org/perlobj
  • https://perldoc.perl.org/perlvar
  • https://perldoc.perl.org/perlstyle
  • https://perldoc.perl.org/functions/open
  • https://perldoc.perl.org/functions/return
  • https://perldoc.perl.org/functions/wantarray
  • https://perldoc.perl.org/autodie
  • https://perldoc.perl.org/feature
  • https://perldoc.perl.org/perlhist
  • https://perldoc.perl.org/perl5260delta
  • https://perldoc.perl.org/perl5360delta
  • https://perldoc.perl.org/perl5400delta
  • https://en.wikipedia.org/wiki/Perl
  • https://en.wikipedia.org/wiki/Raku_(programming_language)
  • https://www.cpan.org/
  • https://metacpan.org/
  • https://metacpan.org/pod/App::cpanminus
  • https://metacpan.org/pod/Carton
  • https://metacpan.org/pod/Moo
  • https://metacpan.org/pod/Moose
  • https://metacpan.org/pod/DBIx::Class
  • https://plackperl.org/
  • https://metacpan.org/pod/Starman
  • https://metacpan.org/pod/Perl::Critic
  • https://metacpan.org/pod/Devel::NYTProf
  • https://metacpan.org/pod/IO::Async
  • https://metacpan.org/pod/Cpanel::JSON::XS
  • https://metacpan.org/pod/Perl::Tidy
  • https://gist.github.com/Grinnz/be5db6b1d54b22d8e21c975d68d7a54f
  • https://blogs.perl.org/users/psc/2022/05/what-happened-to-perl-7.html
  • https://www.perl.com/article/what-is-new-in-perl/
  • https://www.perl.com/
  • https://learn.perl.org/
  • https://www.modernperlbooks.com/books/modern_perl_2016/
  • https://perlmaven.com/perl-tutorial
  • https://perlmaven.com/scalar-and-list-context-in-perl
  • https://blogs.perl.org/users/aristotle/2017/11/perl5-refs-flattening.html
  • https://dev.to/szabgab/perl-weekly-715-why-do-companies-move-away-from-perl-ja6
  • https://www.beatworm.co.uk/blog/computers/perls-decline-was-cultural-not-technical
  • https://www.python.org/
  • https://www.ruby-lang.org/
  • https://www.php.net/
  • https://raku.org/
  • https://www.gnu.org/software/gawk/
  • https://www.gnu.org/software/sed/
  • https://www.gnu.org/software/bash/
  • https://learn.microsoft.com/en-us/powershell/
  • https://go.dev/
  • https://nodejs.org/
  • https://strawberryperl.com/
  • https://www.activestate.com/perl
  • https://mojolicious.org/
  • https://perldancer.org/
  • https://github.com/hachiojipm/awesome-perl
  • https://perldoc.perl.org/perlintro