Hello,

One of my main interests in computer programming is the Perl Language – easy to learn, available for all platforms (probably), comes free with most Unices and can do just about anything. Even Object Orientated programming – Perl core support or using the ubiquitous Moose. From quick hacks to large scale web environments, Perl does The Thing.

I discovered Perl too many years ago to mention when working for a client in Christchurch, Dorset. Someone had downloaded comp.lang.perl.misc to a local server, and I remember just typing :

print "Hello World\n";

.. and ran it using ‘perl hello.pl’. Crikey, no compilation, linking, building or running a virtual machine. Nice.

Perl style

One of the things I most like is that it is easy to learn and try out as per the above example. I learned it with the O’Reilly books : Learning Perl and the classic Perl text called The Camel Book, but now there is a better alternative – Modern Perl – get up to speed quickly using the latest best practices :

modern-perl

There are Perl idioms all over the place. Here’s something from Mojolicious :


use Mojolicious::Lite;

get '/' => {text => 'I ♥ Mojolicious!'};

app->start;

This is an entire web app with server at https://caesuramedia.org:3000/ and it looks most odd to me, but not to modern Perl programmers who are steeped in Perl OO, like this Moose example to create a class representing an x/y coordinate :


package Point;
use Moose; # automatically turns on strict and warnings

has 'x' => (is => 'rw', isa => 'Int');
has 'y' => (is => 'rw', isa => 'Int');
1;

“There Is More Than One Way To Do It”, TIMTOWTDI (and pronounced “Tim Toady” supposedly), is the Perl programming motif – lots of other languages don’t seem to allow such freedom. This has it’s own problems – but one brave soul has attempted to collate a Perl Best Practices collection – subject of much debate in the community and at any of my clients’ Perl factories…

CPAN

And we have a mahoosive collection of plugin/library/extension/add-ons/whatever/ that adds to the core – ta da : The CPAN, The Comprehensive Perl Archive Network – which currently has 173,606 Perl modules in 34,351 distributions, written by 12,862 authors, mirrored on 252 servers. Does C++ have this many open source libraries? Hmmm?

Test

Perl comes with a nice test environment called Test::More, which allows a separation between test program and result interpreter helping Perl programmers develop different testing modules and use them in combination. So tests can be written before the code is written, a nice way to do Test Driven Development.

Support

As with any high level computer language there is oodles of support – from the friendly Perl Monks forum, IRC, and everywhere else.

Anyway, I just wanted to write something about why I like Perl so much, and have given a flavour here, I use Perl at home to Get Stuff Done and at work to please my demanding customers…

CheersO,

~andy~

Categories: Perl