Handy Perl Bits and Pieces

Local installation(s) of Perl | Local copies of Perl documentation | Learning Perl | FAQS, Tutorials, etc | Perl/DBI | Perl/CGI | Perl/Tk | Perl periodicals | Debugging Perl | Beautifying Perl | Other stuff

Where to start looking

One of the `problems' with Perl documentation is that there is so much of it, it's sometimes difficult to know where to start. I have found that it is a good idea to look first at the on-line documentation provided in the Perl distribution using perldoc, (e.g. perldoc perl, or perldoc perldoc) before looking elsewhere. There is a mass of information, examples and tutorial material there.

You can try a quick search for Perl books etc at Amazon.com, below:

Search for:         

A good source of local help are the Perl newsgroups at groups.google.com where Perl users can share problems and solutions. Please use this newsgroup for questions, rather than pestering local Perl `experts' individually!

If all else fails, try running the following command

perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
and heeding the advice given

Local installation(s) of Perl

The default installation of Perl on the local Linux and Solaris networks is the copy that resides in /usr/bin, residing on the local disk of your machine. On Linux this is generally the version of Perl that was current when Linux was last installed (usually the previous summer), with a few extra modules installed.

On NT machines, the ActiveState "build" of perl is installed as C:\perl\bin\perl (along with Tk, libnet, DBI and DBD::Oracle modules).

Another Unix (Linux and Solaris) installation of Perl can be found at /opt/perl/bin/perl. This is almost always a more up to date version, and has a greater collection of modules installed. If your Perl program requires a bleeding-edge version or loads of modules, then this is probably the version to use.

If you want to build your own Perl installation, you can find all you need at CPAN.

Local copies of Perl documentation

Learning Perl

The standard route for beginners is to start with the O'Reilly book
Learning Perl, (you need the turquoise 2nd or 3rd editions, not the now obsolete pink 1st edition), followed by the classics Programming Perl (3rd edition), The Perl Cookbook and Advanced Perl Programming for reference. These books, all from O'Reilly, are the standard texts on Perl.

Another excellent book is Perl: The Programmer's Companion by Nigel Chapman (John Wiley). Unlike the ORA books this treats Perl like a conventional programming language, it even has syntax diagrams! He explains some of the more arcane areas of Perl with a clarity and detachment that I'm afraid is missing from some of the ORA books. The examples are also interesting and clear. This book is definitely worth a read.

Beware of books (on any subject) that promise to teach you any topic `..in 5 days', or somesuch.

Information and reviews of many Perl books can be found at Tom Christiansen's Camel Critiques page, although this doesn't seem to have been updated recently. I would be interested to hear others' opinions on books they have found useful.

Here is a starter exercise that I often give to students learning Perl.

FAQS, Tutorials, etc

Perl/DBI: accessing databases from Perl

The DBI module provides the tools necessary to access databases from Perl. The version of Perl installed (on departmental Linux machines) as /opt/perl/bin/perl will usually have a more up to date version of this module than the Perl in /usr/bin/perl

The local SQL FAQ page gives you the information you need to use the DBI module in the department. For more general information the manual pages can be accessed by typing /opt/perl/bin/perldoc DBI and there is a very good DBI tutorial.


Before even attempting to run CGI scripts in the department, you should read and act on the advice given by the department's Webmaster


Perl/Tk (also known as pTk or ptk) is a collection of modules and code that attempts to wed the easily configured Tk 4 widget toolkit to Perl. In other words, it provides a mechanism for making widgets and programs with Graphical User Interfaces (GUI) using Perl.

Perl periodicals

Debugging Perl

First of all check the perldebug man page. It's also worth remembering that
DDD. (the Data Display Debugger) now supports Perl debugging. There is a local mirror of the DDD documentation.

Beautifying Perl

The perltidy utility is installed in /opt/perl/bin . More information is available by running
/opt/perl/bin/perldoc perltidy
or from the
perltidy home page

Other stuff

Credit to Graham Gough, Manchester Univerity, for large portions of this document