Where to find information on PERL
What is perl?
-------------
Perl is a programming language that combines the features of C, sed, awk,
and sh. Here's an abbreviated excerpt from the beginning of the man page:
Perl is an interpreted language optimized for scanning arbitrary text
files, extracting information from those text files, and printing reports
based on that information. It's also a good language for many system
management tasks. The language is intended to be practical (easy to use,
efficient, complete) rather than beautiful (tiny, elegant, minimal)....
Expression syntax corresponds quite closely to C expression syntax....
If you have a problem that would ordinarily use sed or awk or sh,
but it exceeds their capabilities or must run a little faster, and you
don't want to write the silly thing in C, then Perl may be for you. There
are also translators to turn your sed and awk scripts into Perl scripts.
How do you use perl?
--------------------
There are at least two versions of Perl on each machine. In
/usr/athena/bin/perl is standard across athena platforms (currently,
on Athena 9.1 machines, it's Perl 5.6.1). Installed as /usr/bin/perl
is the vendor's standard version of perl. This varies from platform to
platform (currently on Suns, it's 5.005_03; on Linux workstations, it's
5.6.1, and on SGI's it's 5.004_04)
Writing a "perl script" (a program written in perl) is similar to writing
a normal shell script. However, where you normally specify the shell it
is to be run in (the first line of the script), you would do:
#!/usr/athena/bin/perl
It is important to note that perl has its own language structure, so they
aren't similar in the sense that you could run a shell script in perl.
You would have to learn the perl language before getting very far, anyway.
After writing your script using the editor of your choice, you need to
make your program executable, by doing:
chmod u+x filename
(Note: By tradition, most perl scripts end with a ".pl" suffix.)
Then simply type the name of the filename to run it.
>> You can take a look at a large variety of sample scripts by attaching the
>> perl locker and looking in /mit/perl/scripts/nutshell. (These are from
>> the "Programming Perl" book, mentioned below.)
Is it supported?
----------------
Athena does support perl, however OLC support is very weak. We can help
you in finding information, or trying to get the program up and running,
but we cannot help with writing or debugging of these programs. (This
applies to programming of any sort: unfortunately, it requires time and
resources that the consultants generally do not have.)
Where can I find more information about Perl?
---------------------------------------------
Fortunately, there are many resources that are helpful to perl users,
ranging from introductory to advanced. All users will probably find
the manual entitled "Programming Perl" most useful. (O'Reilly &
Associates, Inc. Publishing). This book is available in our office
(W20-021B), if you wish to come in and take a look at it. However, if
you find yourself using perl a lot, you may want to purchase your own
copy from the MIT Coop at Kendall Square, or from Quantam Books on the
corner of Ames St. and Broadway, behind Legal's Seafood.
In addition, the following resources are available on-line:
o The man page, which is accessible by typing
man perl
This gives a listing of a number of manual sections, each of which
has its own separate man page.
o The perldoc command allows you to get documentation on specific functions
or search based on keywords.
perldoc -f func
perldoc -q keywords
For more information on perldoc, type
perldoc perldoc
o The Perl Mongers website, http://www.perl.org , and O'Reilly's
perl website http://www.perl.com
o Finally, there are several places where you can ask for help. For
starters, there is the zephyr class "help", instance "perl". To
subscribe to the 'help' class and 'perl' instance, type:
zctl sub help perl \*
(Replace "sub" with "add" to make it a permanent subscription.) To
send a message over this instance, type:
zwrite -c help -i perl
Please make sure to be subscribed before you send your question,
or you won't see the responses of people who would like to help
you.
You can also subscribe to all instances of class help, but this
can be a lot of zephyr traffic at times. To subscribe to all
instances of class "help", type:
zctl sub help \* \*
If you want to ask a question about something other than perl on
class help, please send the question to a specific instance. You
can make up whatever instance you like. For example, if you want
to ask a question about noodles, you would type:
zwrite -c help -i noodles
o There is also a mailing list "perl-users@mit.edu", to which you can
send problems or questions. Failing this, there is also a newsgroup
"comp.lang.perl". (For more information about NetNews, type "help" at
your athena% prompt, and look under "Communicating With Other Users".)
|