Summer programming (with PERL): next step: the terminal

Tutoring through the summer, you tend to land in projects.  The tutor brings the PERL project to another early milestone.

In my previous post, I talked practically about what you need to get started with PERL, should you choose to embark. While Macs and Linux systems include PERL, a Windows user might have to download a PERL bundle, of which there are choices (Strawberry and ActiveState being two I’ve used).

Next concern: the text editor used to write the scripts. (For our purposes, a script is a little program). It must produce plain text. Under Windows, Notepad
(All Programs→Accessories→Notepad) will do fine; Linux users have many choices, but I use “text editor” under Apps. As I’ve mentioned, I don’t have a Mac, but I searched a bit yesterday how a Mac user might produce plain text. This article describes how the Mac’s text editor can convert content to plain text using a command under the “Format” menu.

There is a final issue one needs to confront before starting with PERL: getting familiar with the terminal – aka, the command line.

To my knowledge, every operating system has a terminal. One point of difference among operating systems is how much (or little) the terminal is in evidence. Linux users are likely familiar with the terminal. Older people (myself included) recall using MS-DOS on the terminal.

On Windows, the terminal is called Command Prompt, and is under
All Programs→Accessories.

In Linux (perhaps), the terminal is called “terminal”, and is under Apps. (There are many flavours of Linux, but this is true for Ubuntu, anyway.)

For the Mac, this article tells me to find the terminal under “Applications/Utilities”.

For the purposes of running a PERL program, you need to be able to arrive at the location (called the directory) of your script file. Here are the basic commands you need:

Windows:

  • cd changes the directory you’re in.
  • dir tells the contents of the directory you’re in.

Linux or Mac:

  • cd changes the directory you’re in.
  • ls tells the contents of the directory you’re in.

In the next post, I’ll continue with some hints and examples of how to get around in the terminal to find a file. Until then, cheers:)

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

Tagged with: , , , , , , ,

Leave a Reply