Perl

Jun 19

If you receive the following error when trying to install a CPAN module using Mac OS X Leopard and Perl 5.8.8:

No rule to make target `/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE/config.h', needed by `Makefile'.

..then salvation is at hand.

Continue reading »

Jun 6

I recently has a scenario where I had an array of hashes. Each hash represented a row of data for a table and I wanted to sort the whole array by the value of one element of the hash. As you’d expect, Perl has a very nice answer to the problem.

Continue reading »

Apr 18

So, you’re a Perl programmer developing a CGI web application, chances are you’re going to make some mistakes and need to debug your code. By default, when a Perl program fails to compile or encounters a runtime error you will see your servers default HTTP 500 error message.

Continue reading »

Apr 2

Generating a psuedo random number is common programming task. This tutorial will show you how to this in Perl using the rand() function.

Continue reading »

Feb 9

Good software engineering practice dictates that we should always write tests for all of our modules and classes. These tests are called Unit Tests and allow us to perform regression tests every time we change a unit - so we can ensure we haven’t broken anything in the process. The problem is, it can be very time consuming and often regarded as ‘boring’ to write these tests. Thankfully, CPAN provides a number of modules to make this very easy in Perl.

In this tutorial, we go through the process of creating the simplest of test scrips and some easy extensions to make your tests more powerful.

Continue reading »