Perl Installation and Environment Setup in Windows, Linux, and MacOS

Prerequisite: Introduction to Perl

Before, we start with the process of Installing Perl on our System, whether it be Windows, Linux or Macintosh. We must have first-hand knowledge of What the Perl Language is and what it actually does?. Perl is a general purpose, high level interpreted and dynamic programming language. Perl was originally developed for the text processing like extracting the required information from a specified text file and for converting the text file into a different form. Perl supports both the procedural and Object-Oriented programming. Perl is a lot similar to C syntactically and is easy for the users who have knowledge of C, C++.

Perl programs can be written on any plain text editor like notepad, notepad++, or anything of that sort. One can also use an online IDE for writing Perl codes or can even install one on their system to make it more feasible to write these codes. Using an IDE makes it easier to write Perl codes because IDEs provides a lot of features like intuitive code editor, debugger, compiler, etc.
To begin with, writing Perl Codes and performing various intriguing and useful operations, one must have Perl installed on their System. This can be done by following the step by step instructions provided below:

Checking for a preinstalled Perl version:

Before we begin with the installation of Perl, it is good to check if it might be already installed on your System, because many software applications nowadays require Perl to perform their operations, hence a version of Perl might be included in the software’s installation package and hence there is no need to redownload and install the Perl when it already exists. Many Linux systems have Perl preinstalled, also Macintosh provides a preinstalled Perl with their Systems.
To check if your device is preinstalled with Perl or not, just go to the Command line(For Windows, search for cmd in the Run dialog( + R), for Linux open the terminal using Ctrl+Alt+T, for MacOS use Control+Option+Shift+T)
Now run the following command:

perl -v

If Perl is already installed, it will generate a message with all the details of the Perl’s version available, otherwise if Perl is not installed then an error will arise stating Bad command or file name

Downloading and Installing Perl:

Downloading Perl:
Before starting with the installation process, you need to download it. For that, all versions of Perl for Windows, Linux, and MacOS are available on perl.org

Download the Perl and follow the further instructions for installation of Perl.

Beginning with the Installation:

Windows

  • Getting Started:
  • Getting done with the User’s License Agreement:
  • Choosing what to Install:
  • Installation Process:
  • Finished Installation:

Linux

  • Changing Directory to install Perl:
  • Starting the Installation Process:
  • Choosing the Directory to Install Perl:
  • Finishing the Installation:

MacOS

  • Getting Started:
  • Getting done with the User’s License Agreement:

  • Choosing Installation location:
  • Installation Process:
  • Finishing Installation:

After completing the Installation process, any IDE or text editor can be used to write Perl Codes and Run them on the IDE or the Command prompt with the use of command:

perl file.pl

Here’s a sample Program to begin with the use of Perl Programming: Hello World Program in Perl



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.