This subtitle is about the Perl (Perl 5) programming language, more precisely about some typical tasks one encounters while programming in Perl.
The solutions provided here are not always optimal or complete - in fact, they serve much more like starting points, as one might get lost in lengthy code instead of finding the main ideas. Please keep this in mind, and don't comment on the lack of elegance or completeness of the examples
. To create better and nicer code is left as an excercise to the reader
.
I am assuming that you work in a Linux-like environment. As we will be using various CPAN modules, here is a sort note on installing perl modules.
Probably the best way to install a module is to find a binary package, and installing it using a package manipulator, e.g. yum, apt, etc. - depending on what Linux distribution you have. A typical install using Fedora (former RedHat) would be:
yum install fedora_perl_package_name
If you don't have the package, or you don't know its name, and can't find it, you can install the package using the CPAN shell. This looks something like this:
perl -MCPAN -e shell
cpan> install full_perl_module_name
Yet another way is to download the tarball of the module (its a file with a .tar.gz extension), which you have to unpack (typically: tar xfvz filename.tar.gz), enter the created directory, and do what you find in the INSTALL file there. Usually you do something like this:
cd just_created_directory
perl Makefile.PL
make
make test
make install
The trouble with this later method is that dependencies are not always satisfied - however, when manually running makefiles, you might have more options compared to other methods.
And a final note: the methods above usually require supervisor (root) privileges. Most perl modules can be installed locally with simple user privileges, but I will not go into details about that - use your favourite search engine if you are interested.