← Back to Perl Course | Chapter 1: Introduction | Lesson 2 of 7

Installing Perl

Most Linux and macOS machines already have Perl, and Windows users can install a free distribution.

In this page:

  1. Installing Perl

Installing Perl

Linux and macOS normally ship with Perl already installed, so you can check with perl -v. On Windows you can install Strawberry Perl, which bundles a compiler and common tools. To manage several Perl versions, tools such as perlbrew are popular.

Note: Run perl -v to see which version is installed before you install anything.

Example: Installing Perl

bash
$ perl -v
This is perl 5, version 28, subversion 1 (v5.28.1) built for x86_64-linux-gnu-thread-multi

$ sudo apt install perl        # Debian/Ubuntu
$ brew install perl            # macOS with Homebrew
$ \curl -L https://install.perlbrew.pl | bash
$ perlbrew install perl-5.28.1

⚠️ Run this in your own terminal or Node.js environment.

Common Mistakes
  1. Installing a second Perl without checking whether one already exists
  2. Confusing perl -v (version) with perl -V (full configuration)
  3. Editing the system Perl's modules instead of using a separate install for experiments
Chapter Summary
  • Check with perl -v
  • Linux and macOS usually include Perl
  • Strawberry Perl is a common Windows choice
  • perlbrew manages several Perl versions
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.