What lives here

Fifty short lessons, one unbroken chain: every page ends with a link to the next one, so you can read the course start to finish without ever wondering where to click. Each lesson teaches one idea with short Perl examples, from the first script to a tested command line tool:

  1. Start here: What is Perl and where it runs - then follow the chain through lesson 50.
  2. Language core, lessons 2-16: install, first script, debugger, scalars, numbers, strings, interpolation, arrays, array functions, hashes, hash functions, context, conditions, loops, foreach.
  3. Subroutines and data, lessons 17-20: subroutines, arguments, references, nested data.
  4. Text processing, lessons 21-26: regular expressions, captures, substitution, split and join, grep and map, sort.
  5. Files, errors and modules, lessons 27-34: files, file tests, directories, die and eval, modules, CPAN, objects, Moo.
  6. Tooling and the outside world, lessons 35-45: testing, strict and warnings, Getopt::Long, environment, processes, one-liners, CSV, JSON, HTTP, sockets, DBI.
  7. Finish, lessons 46-50: two capstones (todo CLI and log report), performance, modern Perl tour, and the hero roadmap with every lesson on one page.

Course tree

Chapter 0: Install guides ├── Install Perl on Windows 11 ├── Install Perl on Ubuntu ├── Install Perl on Rocky Linux ├── Install Perl on macOS ├── Install Perl on FreeBSD └── Perl in Docker Chapter 1: First steps ├── 01 What is Perl and where it runs ├── 02 Install Perl and check the version ├── 03 Your first Perl script └── 04 The debugger as a REPL Chapter 2: Core types and control flow ├── 05 Scalars and sigils ├── 06 Numbers ├── 07 Strings ├── 08 Interpolation and quoting ├── 09 Arrays ├── 10 push, pop, shift and splice ├── 11 Hashes ├── 12 keys, values, exists and delete ├── 13 Scalar and list context ├── 14 Conditions and comparison ├── 15 while, for, next and last └── 16 foreach and the default variable Chapter 3: Subroutines and data ├── 17 Subroutines ├── 18 Arguments in @_ ├── 19 References └── 20 Nested data structures Chapter 4: Text processing ├── 21 Regular expressions: match and anchors ├── 22 Captures and named groups ├── 23 Substitution with s/// ├── 24 split and join ├── 25 grep and map └── 26 Sort and the Schwartzian transform Chapter 5: Files, errors and modules ├── 27 Read and write files ├── 28 File tests and metadata ├── 29 Directories and paths ├── 30 die, warn and eval ├── 31 Modules and Exporter ├── 32 CPAN and cpanm ├── 33 Objects with bless └── 34 Modern objects with Moo Chapter 6: Tooling and the outside world ├── 35 Testing with Test::More ├── 36 strict, warnings and diagnostics ├── 37 Options with Getopt::Long ├── 38 Environment and %ENV ├── 39 system, backticks and pipes ├── 40 One-liners with -n and -p ├── 41 CSV and TSV processing ├── 42 JSON with JSON::PP ├── 43 HTTP clients with HTTP::Tiny ├── 44 Sockets and IO::Socket └── 45 Databases with DBI Chapter 7: Capstones and finish ├── 46 Capstone: todo CLI ├── 47 Capstone: log report ├── 48 Performance and profiling ├── 49 Modern Perl tour └── 50 Hero roadmap: the whole course on one page

How to use this course

Type every example, do not just read it. Run each snippet with perl or paste it into the debugger before moving on - the course assumes your hands remember lesson 5 by the time lesson 21 arrives.

Two rules carry the whole course: start every file with use strict and use warnings, and let regular expressions do the text work instead of hand-written loops.