Science Gateway > Protocols > Cell Biology Protocols - Table of Contents
Star Republic: Guide for Biologists

Perl on Mac

1. If you are using Mac OS8-9, you would need to go to www.perl.com. Follow the links to find the most current version of Perl. Download and install on your own Mac.

2. Mac OS X ships with Perl 5.6 as a standard component. Here we shall assume that you are using a Mac OS X system.

3. Mac OS X promises an Unix-like enviornment. It is the Terminal application in the Applications/Utilities fold. Double-click on the Terminal icon will open a new window and bring you to the world of Unix command-lines.

4. Try to run Perl by typing in the Terminal window:

perl -e 'print "Perl on Mac OS X\n" '

5. You can write a script in a text editor, save it as a file, and call it from the command line. For example, save the following in a file name my_perl.pl:

#!/usr/bin/perl
print "Perl on Mac OS X\n"; 

Change to the directory where your file is stored. Use cd for change directory and ls for listing the directory content in the Terminal window. Make sure your syntax is correct, and type perl my_per.pl to run the script.