Recent Changes - Search:

Professional

Academic

Personal

Essays and articles

Links

edit SideBar

Perl

Perl is a dynamically typed, run-time compile scripting language. It's characterised by the phrase 'TIMTOWTDI' ('There Is More Than One Way To Do It'). In other words, every idiom in Perl has an alternative syntax. For example:

#!/usr/bin/perl
use strict;
use warnings;
my @array = ("test1","test2","test3");
for my $element (@array)
{
	print "$element\n";
}

is exactly equivalent to

#!/usr/bin/perl
use strict;
use warnings;
my @array = qw(test1 test2 test3);
map {print "$_\n"}@array

and there are many other ways to construct the same thing. This gives the developer scope to write code in the clearest way possible, depending on the context.

The inclusion of

use strict;
use warnings;

above is important. Perl can be written without these, but 'use strict' imposes a number of compile time checks, and 'use warnings' imposes other checking. Although these can be omitted, without them Perl is little more than a vehicle for quick and dirty scripts (note: you can write 'strict safe' Perl code without the strict pragma switched on, but why not have that guard against typos?). Most of the poor quality code (that impairs the languages reputation) in Perl is written without these facilities turned on. Some developers would have you believe that Perl is 'dead', or 'old tech'. Nothing could be further from the truth. In fact, Perl has been around long enough to have developed a mature, reliable open source library set (CPAN) with a huge range of ready to use code. There is a thriving language community, and Perl is widely used 'behind the scenes'. One of the problems besetting Perls image is that it is widely used for 'behind the scenes' applications, because it gets the job done quickly and efficiently. Another criticism commonly levelled is that Perl is 'just a scripting language'. Well, yes, it is a scripting language, but I'd take issue with 'just'. Dynamic typing does mean that you have less control over data types than say Java or C++, but it does mean that Perl is quicker and easier to develop in. If you have complex mathematical operations to handle which require a static typing system, then you should probably be using C - if you want to manipulate data quickly and easily, Perl is the natural choice.

I've been writing Perl code since 2000, and involved in the community since 2005. I'm a regular attendee of YAPC::EU, the organiser of Leeds.pm (The Leeds, West Yorkshire based Perl user group), and author of 3 CPAN modules (publicly downloadable reusable Perl libraries). I'm also a regular user at perlmonks.org.

Perl 6

Perl 6 addresses some of the shortcomings of Perl 5. In particular, the probably over-forgiving acceptance of symbolic references and lack of compile time variable checking, along with the rather free form OO facilities, are being improved.

Perl 6 is widely regarded as vapourware, and there's a degree of truth in that. The specification has been evolving for some years now without a formal release of the language. There are many reasons for this - Larry et al want to get the spec right, work is still in progress on the underlying virtual machine (Parrot). But the reference version of Perl 6 that comes with Parrot implements a proportion of the spec, PUGS implements most of it, and V6 implements the bulk of the Perl6 standard in Perl5. Ultimately Perl 6 will be self bootstrapping and based on Parrot. Although the 'official' version isn't here yet, work is still underway, and accelerating.

Edit - History - Print - Recent Changes - Search
Page last modified on February 05, 2008, at 10:17 PM