Summer PERL programming: running first script for Linux & Mac users

In the context of tutoring, a lazy summer day might mean academic pursuits at a relaxed pace.  The tutor acknowledges the need to bring Linux and Mac users equal with Windows users:  in this installment, he offers instructions for Linux and Mac users to execute their first PERL script.

In my previous post I instructed Windows users through the execution of their first PERL script. Now, Linux and Mac users, it’s your turn.

Open your text editor and type in the following:

#!/usr/bin/perl

print “Hello, how are you?–from PERL!\n\n”;

Let’s imagine you call your file july101 and save it in your “My_perl_programs” folder. In my experience, you can save it as type “all files” or type “text files” – just as long as it’s actually plain text.

Now, open your terminal and go into your “My_perl_programs” directory. Enter the command ls to make sure your file july101 is listed. Assuming you see it, enter the following command:

perl july101

If the process works, the terminal should reply with

Hello, how are you?–from PERL!

If you receive that greeting, congratulations! You, Linux or Mac user, have successfully executed your first PERL script.

The next few posts, we’ll review what we did during this one and last one. To quote Phil Collins in his hit song Against All Odds:

“There’s so much I have to say to you/So many reasons why….”

We’ll get to it all, in the coming days:)

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Tagged with: ,

Leave a Reply