Before we can start learning the Perl language, we need to install the Perl execution environment.
Perl can run on the following platforms:
Unix (Solaris, Linux, FreeBSD, AIX, HP/UX, SunOS, IRIX etc.)
Win 9x/NT/2000/
WinCE
Macintosh (PPC, 68K)
Solaris (x86, SPARC)
OpenVMS
Alpha (7.2 and later)
Symbian
Debian GNU/kFreeBSD
MirOS BSD
Wait a minute…
Perl is already installed by default on many system platforms, and we can check whether it is installed by using the following command:
$ perl -v
This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)
Copyright 1987-2013, Larry Wall
……
If you output the above information to indicate that it has been installed, if it is not already installed, you can see the following installation instructions. We can download the installation package for the corresponding platform: https://www.perl.org/get.html on Perl’s official website. The steps to install Perl on a Unix/Linux system are as follows: Open it through a browser http://www.perl.org/get.html。 Download the source package for Unix/Linux. Download Next, if we After the installation is successful, the installation path of Perl is Perl has ActiveStatePerl and Strawberry Perl compilers on the Window platform. The biggest difference between ActiveState Perl and Strawberry Perl is that Strawberry Perl contains more than some modules in CPAN, so the installationfiles downloaded by Strawberry Perl are more than 80m, while ActiveState Perl is only about 20m. We use Strawberry Perl here. The steps to install Perl on a Window system are as follows: Link to the Strawberry installation package: http://strawberryperl.com . Download the version of your system: 32bit or 64bit. After downloading, double-click to open it, and press the installation wizard to install it step by step. Mac OS systems generally have Perl installed by default. If not, perform thefollowing steps: Open it through a browser http://www.perl.org/get.html。 Download the source package for Mac OS. Download After successful execution, the installation path of Perl is Perl can be executed in different ways. We can execute the perl code directly from the command line. The syntax format is as follows: The command line parameters are as follows: Option Description Run the program in debug mode Specify the @ INC/#include directory Allow pollution detection Allow pollution warning Allow unsafe operations Allow a lot of useful warnings Allow all warnings Disable use warning Execute perl code Execute perl script file We can put the perl code in a script file and execute the file code with thefollowing command: We can also execute perl scripts on some graphical user interface (GUI) environments. The following two common Perl integrated development environments are recommended: Padre Padre is an integrated development environment for Perl language developers, providing syntax highlighting and code refactoring. EPIC EPIC is a plug-in for Perl Eclipse IDE. If you are familiar with Eclipse, you can use it. Installation steps: Help– > Eclipse Marketplace– > enter EPIC– > Select install and update. 5.3.1. Install Perl #
5.3.2. Unix and Linux install Perl #
perl-5.x.y.tar.gz
to do the following after the file.$ tar -xzf perl-5.x.y.tar.gz
$ cd perl-5.x.y
$ ./Configure -de
$ make
$ make test
$ make install
perl
-v
command to see if the installation was successful.
/usr/local/bin
, the library is installed in the
/usr/local/lib/perlXX
, XX is the version number. 5.3.3. Window install Perl #

5.3.4. Mac OS install Perl #
perl-5.x.y.tar.gz
to do the following after the file.$ tar -xzf perl-5.x.y.tar.gz
$ cd perl-5.x.y
$ ./Configure -de
$ make
$ make test
$ make install
/usr/local/bin
, the library is installed in the
/usr/local/lib/perlXX
, XX is the version number. 5.3.5. Run Perl #
5.3.6. 1.Interactive #
$perl -e <perl code> # Unix/Linux
or
C:>perl -e <perl code> # Windows/DOS
-d[:debugger]
-Idirectory
-T
-t
-U
-w
-W
-X
-e
program
file
5.3.7. 2.Script execution #
$perl script.pl # Unix/Linux
or
C:>perl script.pl # Windows/DOS
5.3.8. IDE:Integrated Development Environment #
