Why Learn Perl?

A couple of months ago I mentioned some public training courses that I’ll be running in London next month. The courses are being organised by FlossUK and since the courses have been announced the FlossUK crew have been running a marketing campaign to ensure that as many people as possible know about the courses. As part of that campaign they’ve run some sponsored tweets, so information about the courses will have been displayed to people who previously didn’t know about them (that is, after all, the point of marketing).

And, in a couple of cases, the tweet was shown to people who apparently weren’t that interested in the courses.

As you’ll see, both tweets are based on the idea that Perl training is pointless in 2016. Presumably because Perl has no place in the world of modern software development. This idea is, of course, wrong and I thought I’d take some time to explain why it is so wrong.

In order for training to be relevant, I think that two things need to be true. Firstly the training has to be in a technology that people use and secondly there needs to be an expectation that some people who use that technology aren’t as expert in as they would like to be (or as their managers would like them to be). Let’s look at those two propositions individually.

Do people still use Perl? Seems strange that I even have to dignify that question with a response. Of course people still use Perl. I’m a freelance programmer who specialises in Perl and I’m never short of people wanting me to work for them. I won’t deny that the pool of Perl-using companies has got smaller in the last ten years, but they are still out there. And they are still running successful businesses based on Perl.

So there’s no question that Perl satisfies the first of our two points. You just have to look at the size of the Perl groups on Facebook or LinkedIn to see that plenty of people are still using Perl. Or come along to a YAPC and see how many companies are desperate to employ Perl programmers.

I think it’s the second part of the question that is more interesting. Because I think that reveals what is really behind the negative attitude that some people have towards Perl. Are there people using Perl who don’t know all they need to know about it?

Think back to Perl’s heyday in the second half of the 1990s. A huge majority of dotcoms were using Perl to power their web sites. And because web technologies were so new, most of the Perl behind those sites was of a terrible standard. They were horrible monolithic CGI programs with hard-coded HTML within the Perl code (thereby making it almost impossible for designers to improve the look of the web site). When they talked to databases, they used raw SQL that was also hard-coded into the source. The CGI technology itself meant that as soon as your site became popular, your web server was spawning hundreds of Perl processes every minute and response times ballooned. So we switched to mod_perl which meant rewriting all of the code and in many cases the second version was even more unmaintainable than the first.

It’s not surprising that many people got a bad impression of Perl. But any technology that was being used back then had exactly the same problems. We were all learning on the job.

Many people turned their backs on Perl at that point. And, crucially, stopped caring what was going on in Perl development. And like British ex-pats who think the UK still works the way it did when they left in the 1960s, these people think the state of the art in Perl web development is those balls of mud they worked on fifteen or twenty years ago.

And it’s not like that at all. Perl has moved on. Perl has all of the tools that you’d expect to see in any modern programming language. Moose is as good as, if not better than, the OO support in any other language. DBIx::Class is as flexible an ORM as you’ll find anywhere. Plack and PSGI make writing web apps in Perl as easy as it is in any other language. Perl has always been the magpie language – it would be crazy to assume that it hasn’t stolen all the good ideas that have emerged in other languages over the last fifteen years. It has stolen those ideas and in many cases it has improved on them.

All of which brings us back to my second question. Are there people out there who need to learn more about Perl? Absolutely there are. The two people whose tweets I quoted above are good examples. They appear to have bought into the common misconception that Perl hasn’t changed since Perl 5 was released over twenty years ago.

That’s often what I find when I run these courses. There are people out there with ten or fifteen years of Perl experience who haven’t been exposed to all of the great Modern Perl tools that have been developed in the last ten years. They think they know Perl, but their eyes are opened after a couple of hours on the course. They go away with long lists of tools that they want to investigate further.

I’m not saying that everyone should use Perl. If you’re comfortable using other technologies to get your job done, then that’s fine, of course. But if you haven’t followed Perl development for over ten years, then please don’t assume that you know the current state of the language. And please try to resist making snarky comments about things that you know nothing about.

If, on the other hand, you are interesting in seeing how Perl has changed in recent years and getting an overview of the Modern Perl toolset, then we’d love to see you on the courses.

Author: Dave Cross

Dave Cross runs Magnum Solutions Ltd., a London Perl consultancy. In 1998 he started London Perl Mongers, the first Perl Mongers group outside of Northern America.

5 thoughts on “Why Learn Perl?”

  1. While i agree with the sentiment of the continuation of corevdevelopment how widespread is its use, last look at the git installer was shipping 5.8.

    In an odd twist of fate it may havr assigned the Perl 5 resources to Perl 6 and ensure that it came in quicker with more widespread suport.

    Shouldn’t the Perl community now be pushing for 6 now?

    1. Should the C community be pushing for C# or C++? The level of difference between Perl 5 and 6 is that sort of schism. Plenty of people who liked C also like C++ or C# but there is still a use for C as it has always been. Rather than the Python 2 vs 3 sort of slow persuasion, Perl has essentially completely reimagined itself as a different language. Ultimately Perl 5 might as well just switch to the middle version number as its actual version, its been that way unofficially for some time now, much like Java did to keep up with version wars. Perl 6 as a language spec is doing lettered versions that are sequential A-Z relating to religious holidays 6.C is the current release and 6.D is already being planned.

    2. I’ve never been more excited about Perl 5. I don’t think we should be pushing for Perl 6. They are separate languages.

      What is being pushed for is the excitement brewing from the all the work that has transpired via the Modern Perl movement.

      We have modern web frameworks (Mojolicious, Dancer, PSGI/Plack); YEARLY releases of Perl 5; CPAN has never been easier to work with (cpanm, cpanfile, carton); a healthy and supportive community; and modern infrastructure to work with OO (e.g. Moose).

      There are several of other things I haven’t mentioned.

  2. There are people out there with ten or fifteen years of Perl experience who haven’t been exposed to all of the great Modern Perl tools that have been developed in the last ten years.

    If you haven’t been learning new things about a subject for the past ten years, then you don’t have ten years of experience in that subject, you just have one year ten times over.

Leave a Reply