Perl Installation On A Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS
Install perl
-
Debian
apt-get install perl-baseClick to copy -
Ubuntu
apt-get install perl-baseClick to copy -
Alpine OS
apk add perlClick to copy -
Arch Linux
pacman -S perlClick to copy -
Kali Linux
apt-get install perl-baseClick to copy -
CentOS
yum install perl-baseClick to copy -
Fedora
dnf install perl-baseClick to copy -
Raspbian
apt-get install perl-baseClick to copy -
macOS
brew install perlClick to copy
The Perl 5 language interpreter.
How to use perl?
Below are few example commands for perl that you can use in the terminal.
Parse and execute a Perl script:perl script.plClick to copyCheck syntax errors on a Perl script:perl -c script.plClick to copyParse and execute a perl statement:perl -e perl_statementClick to copyRun a Perl script in debug mode, using `perldebug`:perl -d script.plClick to copyLoo[p] over all lines of a file, editing them [i]n-place using a find/replace [e]xpression:perl -p -i -e 's/find/replace/g' filenameClick to copyRun a find/replace expression on a file, saving the original file with a given extension:perl -p -i'.old' -e 's/find/replace/g' filenameClick to copyRun a multi-line find/replace expression on a file, and save the result in another file:perl -p0e 's/foo
bar/foobar/g' input_file > output_fileClick to copy
Installing perl command is simple. just copy one of the above commands for your operating system and paste it into terminal. This command is available for Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian and macOS operating systems. Once you run the command it will install the latest version of perl 2026 package in your OS.




