Perl Programming   «Prev 

Hello World! on Mac

Step - Create the Perl script

Copy the two-line Perl program below into your favorite text editor and save the file as hello.pl.

#!/usr/bin/perl
print "Hello, World!\n";

Saving .pl file

You can save the .pl file anywhere.
However, you may want to create a special working folder for this course in which you will save all of your scripts.

Step 2 - Run the script

Open MacPerl. Select Run Script from the Script menu.
From there, you will be prompted to select a file. Navigate to hello.pl and click Open.
The program should run and print:

Hello, World!

Perl Installation

If this program is not working, you may want to consult the application documentation carefully before posting a message to the forum.
Chances are it's a problem with the installation.