Regenerating Perl School

About five years ago I ran a few training courses under the Perl School brand. The idea was simple – if you price training courses cheaply and run them at the weekend then you eliminate the most common reasons why people don’t keep their Perl knowledge up to date.

Of course, it’s not quite that simple. And I think I ran six courses before running out of attendees.

But there are still people who would benefit from getting some more up to date information about how Perl works. So I’ve decided to resurrect the Perl School brand in a new attempt to spread the Modern Perl knowledge beyond the echo chamber. I announced my plans during my lightning talk at last month’s London Perl Workshop.

This time I’m going to do it by publishing cheap books. You might remember that time I promised to write a guide to modern web development with Perl and how badly that ended up. But in the process, I learned a lot about publishing ebooks to Amazon. I even gave a talk where I suggested that Perl book publishing could become a cottage industry. And that’s what I’m currently aiming at.

I’ve made a start already. just before the LPW I published a book called Perl Taster which aims to take people through their first two hours of learning Perl. It’s cheap enough (and small enough) that people can give Perl a try without investing too much money or time.

But my plans don’t stop there. I have ideas for half a dozen other books that I can publish over the next few months. Basically, if you’ve one of my training courses over the last five years then you can expect a (short!) book based on that course to appear at some point during 2018. Currently my plans include books on:

  • Moose
  • DBIx::Class
  • Modern Core Perl
  • Dancer2
  • Testing

Obviously, there are plenty of other books that could be written this way. And I don’t want to have to write them all myself. Which is where you come in. Is there a Perl-related subject that you’re an expert on? Would you be interested in writing a book about it?

I’m offering to help people publish Perl books. If you can write a book using Markdown, then let me take care of the complicated bits of turning your text into an e-book and getting it published on Amazon (and, perhaps later, other e-book platforms).

So, over to you. What do you want to write a book about.

p,s. At some point I should probably finish the e-book I was writing about publishing e-books.

London Perl Workshop Report

Lightning Talks Preparation at the LPW 2017

(Photo above by Chris Jack)

Last Saturday was the annual London Perl Workshop. I should write up what happened before I forget it all.

I arrived at about 8:30 in the morning and was able to check in quickly – collecting a bit of swag which included a free t-shirt as I was a speaker. I then made my way up to the main lecture theatre in order to see Katherine Spice welcoming people to the day on behalf of the new team of organisers. After that headed off to the smaller lecture theatre to set up for my tutorial. There were a few differences from previous years. Firstly, I was giving a completely Perl-free tutorial (about on-page SEO techniques) and secondly, I had been moved out of the tutorial track and into one of the main talk tracks. As a side effect of that second change, I was also asked to trim my talk from my usual two hours to a more “talk-like” eighty minutes.

The talk seemed to go well. I got some interesting questions and a few people came up to me later in the day to tell me they had found it interesting useful (sometimes both!) The slides to the talk are available on SlideShare: Web Site Tune-Up – Improve Your Googlejuice.

Following that, I had time to see one talk before the coffee break and I chose Why learning a bit of Crypto is good for you‎ by Colin Newell. Colin gave a good (if, necessarily rather shallow) explanation of how learning a small amount of cryptography can help you improve the security of your systems.

Then it was was the morning coffee break. For the past few years, this break has traditionally included cakes which were supplied by a sponsor. When that didn’t look like happening this year, organiser Neil Bowers (with a gentle nudge from Leon Timmermans) came up with the idea of a community bake. And that’s what happened. A number of attendees baked cakes for us all. I had one of Neil’s blueberry muffins and it was lovely.

There was a slight change in the schedule after the coffee break. Matt Trout was unable to be at the workshop so, at the last minute, JJ Allen stepped in and gave his talk To delete or not to delete, that is the question‎, which was about some impending data protection laws which will affect all businesses. I stayed in the same room to see Neil Bowers explain The PAUSE Operating Model‎ and then JJ returned to talk about something completely different – Perl and Docker, sitting in a tree‎.  JJ’s company, Opus VL, have released some of their Docker infrastructure code to CPAN and I’m sure many people will find it useful.

Then it was lunchtime. I bought a sandwich from the university’s cafe and sat in the foyer talking to various friends who walked past.

I started the afternoon watching Paul Evans on ‎Devel::MAT updated‎. Devel::MAT is a development tool which aims to do for memory analysis what Devel::NYTProf does for profiling. It looks very useful. That was followed by Julien Fieggehenn’s talk Turning humans into developers with Perl‎. Julien doesn’t just train people in Perl, he acts as a mentor for them for a couple of months when they join his company, so he was able to talk in some detail about much wider issues than just choosing which topics to cover in a training course.

Talking about wider issues, I then saw Tom Hukins’ talk Development: More than Writing Code?‎ Tom is, of course, right that there’s more to being a good developer than just writing good code. This is a topic that I’m thinking of developing a training course on. Tom was followed by Paul Johnson giving good advice on Modernising A Legacy Perl Application.

The afternoon coffee break included some professionally baked pastries. They were also lovely, but don’t think they were appreciated quite as much as the morning’s community versions.

After the coffee break, we all gathered in the main lecture theatre for the plenary session. Ann Barcomb spoke about Fifteen Years of Contributing Casually‎. Ann was once a Perl developer. I first met her at the first YAPC::Europe in London in 2000 and she was then part of the organising team for the second YAPC::Europe in Amsterdam in 2001. But since then she has become a researcher into the sociology of the open source movement. You can read a lot of her research on her web site. Her talk illustrated her findings with some personal anecdotes about her own casual contributions to the Perl community. Everyone seemed to find it fascinating and the Q&A at the end of the talk showed every signs of turning into a full-scale discussion. On a personal level, it was great to catch up with Ann again about fifteen years after we had been in the same room together.

And then there were the lightning talks. They were their usual mixture of intriguing and entertaining. Mark Keating (enjoying his first LPW that he wasn’t organising) implored us to get involved in the Enlightened Perl Organisation. I announced a plan to publish more Perl books (of which, more later). I was particularly impressed by Kenichi Ishigaki who flew in from Japan just to give a lightning talk about his module Perl::PrereqScanner::NotQuiteLite.

After that, there were a few closing words from Neil Bowers and, in another innovation brought in by the new organisers, drinks were served on site rather than in a local pub. Of course, some people went off to a local pub after that as well.

As always, it was a great day. The new organising team seem to have hit the ground running and produced an impressive workshop. My thanks to the organisers, the volunteers, the speakers, the sponsors and all of the attendees.

I’m already looking forward to next year’s workshop.

London Perl Workshop Klaxon

The London Perl Workshop is looking frighteningly imminent. It’s on November 25th – that’s less than three weeks away. All across the capital (and even further afield) if you listen hard you will hear the sounds of speakers frantically trying to get their talks ready.

That, at least, is how I have spent my weekend. I’m presenting a new training course at the workshop and I’ve been working hard on the slides for the last couple of days.

This new course is a bit of an experiment for me. It’s a completely Perl-free session. For most of this year, I’ve been working for a well-known property portal and the work I’ve been doing for them has concentrated on search engine optimisation and I’m going to take this opportunity to share some of my new-found knowledge with a room full of people.

I know what you’re thinking. SEO is either a) really dull keyword research or b) snake-oil. To be fair, I’ve seen both of those things, but that’s not what I’m going to be covering. I’d hate to be seen as either boring or a snake-oil salesman!

No, I’m going to be covering something that I think is far more interesting. The course will be all about making your web site more attractive to Google. And if Google likes your web site, they will crawl your site more often, extract more useful information from it and (hopefully) show your site in response to more user search queries. Getting your site to appear in more search results means more visitors and more visitors means a more successful web site.

I won’t be covering anything complicated. There’s nothing that you won’t be able to implement in a couple of hours. Anyone could use these techniques – but the point is that most people don’t. That’s why they work.

The schedule hasn’t been published yet, so I don’t know when I’ll be giving the talk, but I expect to have that information in the next few days. I do know that my slot is 80 minutes – that’s because the organisers have received a large number of high-quality proposals, so we all have to squeeze up a bit to fit in as many of them as possible.

The London Perl Workshop is one of my favourite conferences. The range of talks is always great. And it seems that this year’s workshop (which has a new organising team) is going to be no exception.

Hope to see some of you on 25th November.

Yak Shaving with Aphra Behn

Aphra Behn Frontispiece

I have a few ideas for static web sites that I want to build. And, currently, the best place to host static web sites is, in my opinion, Github Pages.

And if you’re hosting a site on Github Pages, everyone knows that the best tool to use is Jekyll. Or is it?

I’ve tried to use Jekyll a couple of times and it just confused me. Something about the way it works just doesn’t fit into my head in some way. I’m not sure what it is, but every time I change something, it all breaks completely. I’m sure the problem is with me rather than the software. Everyone else seems to get on with it just fine.

So, anyway, when faced with a problem like that I did what any self-respecting geek would do. I wrote my own tool to solve the problem.

And, of course, I wrote it in Perl (because that’s what I know best) and I used the Template Toolkit (because, well, why wouldn’t I). And because I wrote it to reflect the way that I think about building static web sites, I understand how it works.

To be honest, how it works is pretty simple so far. It takes a bunch of files in an input directory, processes them using the Template Toolkit and writes them into a mirror directory structure under an output directory. So far, not so different to tttree (the tool that comes with the Template Toolkit), but there’s one little improvement that I’m finding very useful.

I like writing text using Markdown. And I thought that it would be great to write text in Markdown, but have it pre-processed to HTML before passing it through the Template Toolkit. A couple of months ago I released Template::Provider::Pandoc which does just that (actually, it does a lot more than that – it will convert between any two text formats that are supported by Pandoc.

And my new site builder software used Template::Provider::Pandoc to process all of the templates in the site. You don’t really want to be using Markdown for the main layout of your site – Markdown is rubbish for building navbars, footers or image carousels – but when I have a large amount of text, I can [% INCLUDE %] a template which includes that text in Markdown, knowing that it will be converted to HTML before being included in the page.

I’ve called the software aphra (for reasons that I’ll get to in a minute). There’s an early version on CPAN and the code is, of course, on Github too.

If you want to try it out, the best documentation, currently, is in the command line tool, aphra, that comes with the distribution.

What about that name?

Yes, it’s a strange name.

When I first realised I’d be writing something like Jekyll, I wanted to call it Hyde. I wanted to be able to say that it was uglier and more powerful than Jekyll. But there’s already a Python sitebuilder called that. Then I considered Utterson (he’s Henry Jekyll’s friend in the novel) but that had been taken too.

So I abandoned the idea of using the name of a character from The Strange Case of Dr Jekyll and Mr Hyde and started looking elsewhere.

I first came across Aphra Behn when I read Philip José Farmer‘s Riverworld books about thirty years ago and she has stuck with me ever since. [I should point out for people who haven’t read Farmer’s books that he takes real historical characters, like Behn, and drops them into a science fiction environment.]

Behn was a British writer who wrote novels, plays and poetry in the second half of the seventeenth century. At a time when women simply didn’t do those things, it just didn’t seem to occur to her that she shouldn’t. She was a great role model to many of the great women writers of the following centuries.

Oh, and she was a spy too, during the Second Anglo-Dutch War.

All in all, she was an inspirational woman who deserves wider recognition. And I hope that, in some small way, that my software will raise her profile.

What’s next?

So now I have my tool, it’s time to start creating the web sites that I wanted. I hope to have some news on those for you in a few weeks.

Or, perhaps, I’ll get bogged down creating a web site for Aphra. I’ve just registered a domain name…

Genealogical Timelines in Perl and SVG

Genealogical Timeline for Prince George

If you ever read my (mostly dead) more general blog, you might know that I’m a bit of an amateur genealogist. I’ve been tracing my family for over twenty-five years and I’ve got some branches of it back to the 1700s (actually, I have one branch back to the late 1600s).

One problem in genealogy is how to present data in a readable and easily-understandable way. Family trees are messy things. Both the roots and the branches can get very tangled. A good way to cut through all of that is to ignore unnecessary branches and just show the ancestors of a given person on the tree.

And that’s what the image at the top of this post shows. In the right-hand side of the image, halfway down, you will see Prince George of Cambridge (ok actually, you’ll see “Princ”, that’s a bug that I need to fix – it works when someone’s lifespan is long enough to fit their name in!) Above and below him (at a quarter and three-quarters of the way down the page) you’ll see his parents. And so on back through time until on the left of the page you’ll see his great, great, grandparents – most of whom were born back in the nineteenth century.

It’s all created with a Perl program, of course. I’ve just uploaded SVG::Timeline::Genealogy to CPAN (it should be there at some point later today) and that can be used to draw these diagrams.

The module is very similar to SVG::Timeline which I wrote about a couple of weeks ago. And that’s completely unsurprising as it’s a sub-class of that module. Interestingly, early drafts of this module pre-date SVG::Timeline, but I recently realised that it should be a sub-class so I spent yesterday re-implementing it (and making more than a few changes to SVG::Timeline as some idiot had made it hard to sub-class!)

There are two ways to use the module. The hard way involves writing your own code:

The easy way involves putting the information in a data file and using the treeline program that is included in the distribution.

The fields in the data are separated by tabs.

The important bit to get right is the “ahnen” attribute. “Ahnen” is short for “Ahnentafel Number” and it’s a concept that is common in genealogy. You take a person in your family tree (say you for example) and give that person a number of 1. Your father then has a number of 2 and your mother is 3. Carry on with that scheme through the generations. You paternal grandparents are 4 and 5, your maternal grandparents are 6 and 7… and so on.

These numbers have a couple of interesting properties. Firstly, if a person has an Ahnentafel Number of $x, then their parents are 2 * $x and 2 * $x + 1. Secondly, with the exception of person 1 (who can obviously be of either sex) all the men have even numbered Ahnentafel Numbers and the women all have odd numbers.

It is therefore these numbers that allow us to convert a flat data file into a tree structure. They tie the records together in the correct order. If you want to know more, I have a module called Genealogy::Ahnentafel which allows you to manipulate these numbers in various ways.

So that’s, SVG::Timeline::Genealogy. Hope you find it useful. Please share any interesting genealogies that you find.