From: jaf@unb.ca Date sent: Thu, 12 Jun 1997 13:57:16 -0300 (ADT) To: peasley@unb.ca Subject: Perl Perl is installed on all CSD servers/workstations via the path /usr/local/bin/perl. There are other ways to get at the program, however, this path should always get you the most recent version of Perl available with the richest choice of modules. Note that the version of perl available on the Solaris 1 systems is not as up to date as the Solaris 2 nor are as many modules available. If you are teaching a course in Perl using our systems, I would strongly recommend then, that you advise people to use only the Solaris 2 systems (sol or workstations in D-7 or equivalent systems.) To create a Perl script, you can use the editor of your choice. I would recommend vim (Vi IMproved), a vi compatible superset with many usability enhancements. I have a vim tutorial available based on a seminar which I gave to our IS group at: http://www.unb.ca/documentation/UNIX/UNIX.new-user/vim/ You can, however, use any text editor you choose and we have the standard vi editor as well as emacs available. You can use textedit if you are telnetting to our system from an X server (an X terminal, a workstation running Motif/CDE/OpenWindows/etc... or a PC running one of the X servers available), however, if you want a GUI editor, note that emacs automatically opens a GUI edit window if the DISPLAY environment variable is set and vim has a -g option to launch a GUI interface. Both vim and emacs are vastly superior to textedit as editors. The first line of your script must be #!/usr/local/bin/perl with no leading spaces or blank lines and you will have to make your script executable and readable. For example, here I create a Perl script to print hello world! without using an editor: sarastro [~/bin] {jaf.66}% echo #\!/usr/local/bin/perl > example sarastro [~/bin] {jaf.67}% echo 'print "hello world\!\n";'>>example sarastro [~/bin] {jaf.68}% chmod 755 example sarastro [~/bin] {jaf.69}% example hello world! sarastro [~/bin] {jaf.70}% cat example #!/usr/local/bin/perl print "hello world!\n"; sarastro [~/bin] {jaf.71}% If you have any additional questions, please feel free to ask. You might also look at: http://www.unb.ca/Sample/perl or on sol, /web/Sample/perl, which contains example scripts which I put together as part of a seminar on Perl. -- O- J. Anthony Fitzgerald, jaf@UNB.ca, http://www.unb.ca/csd/staff/jaf/ -O