Saturday, January 18, 2020

Installation and "Hello, World!" Program

Installation

Begin by going to the website for the Padre IDE (padre.perlide.org/). Click on the “Download” link in the top right corner of the page.

Now click on the appropriate download for your operating system. I am using Windows, so the steps that follow will be for installation on Windows. Click on the first link in the “Windows” section of the download page.

This will take you to a page where you can select which version to download. Select the third link file on the page (the first two are for Linux operating systems, and the last one is an older version).

Wait for the download to complete, then run the executable. Follow the steps in the installation wizard to install the Padre IDE. Once the install is complete, open the IDE by clicking on its icon in the Start menu.

The “Hello, World!” Program

Once you have installed Perl (which is included in the Padre IDE’s installation package), it is a good idea to create and run a simple program to confirm that the execution environment has been installed successfully and is working properly. The program traditionally used for this purpose is known as the “Hello, World!” program after the text it prints to the screen.

Padre should have automatically opened a new blank file when you started it. If not, you can open a new file by pressing Ctrl-N. On the first line of the file, type print "Hello, world!\n"; (the \n represents a newline character). Save the file as HelloWorld.plx, and then run it by pressing the F5 key. You should see a black window pop up that contains the text

Hello, world! Press any key to continue . . .

The contents of HelloWorld.plx together with the output window are shown below:

Background Information and Resources

Creation and History

Perl was the brainchild of linguist and NASA sysadmin Larry Wall, who developed it in the late 1980s as a language designed to make report processing easier. Since that time, it has grown beyond this original role to take on such tasks as automated system administration and connecting different computer systems together. It has also become one of the most popular languages for programming Common Gateway Interfaces (CGIs) on the Internet.

Resources

For the purposes of this blog, I will be using Beginning Perl (available free online at perl.org/books/beginning-perl/) as my primary resource for learning the syntax and conventions of the Perl language. I will be creating and executing my Perl scripts through the Padre IDE (padre.perlide.org/).