Categories
Miscellaneous

Down the rabbit hole

Blog posts are like busses. You wait months for one and then two come along on consecutive days!

Yesterday I wrote about how we didn’t need a blogging platform for the Perl community – all we really needed was a good-looking feed aggregator. I mentioned Perlsphere as one such aggregator.

Then Matthew commented, saying that Perlsphere looked a bit broken as Dave Cantrell’s posts from a few years ago frequently pop up there as new posts. I had a quick look at the problem and couldn’t quite work out what was going on. His web feed seems valid, but Perlsphere didn’t seem to recognise the dates of the posts.

Perlsphere is implemented using Plagger, a feed aggregator written my Miyagawa a very long time ago (back when it seemed that web feeds were going to conquer the world). It’s a pretty complex beast and it seemed possible that somewhere deep in its code, it was mis-parsing Dave’s web feed. So I cloned the repo and tried to work out what was going on.

But Plagger hasn’t been updated for a very long time. As you can see from the test results, it stopped passing its tests a long while ago (I suspect when the current directory was removed from @INC). I spent a brief time trying to get it working but, ultimately, decided it was too hard a job.

So I took another look at Perlsphere. And I decided that if it’s based on bit-rotten software, it’s not going to be very easy to maintain (which gave me flashbacks to blogs.perl.org!)

But there’s another Perl tool for aggregating web feeds. And I wrote it. It’s called Perlanet (and, boy, do I regret that name now). Back in the first decade of this millennium, I was fascinated by web feeds and the idea of using them to build local “planets” – a web site that aggregated web feeds that had interesting information about your local area. Of course, that was back in the days when everything had a web feed and it was simple enough to pull them together and create really quite interesting sites. These days, of course, web feeds are rather unfashionable and almost no-one thinks to add them on to their web site.

However, they still cling to life in the world of blogging. Mainly, I suspect, because blogging platforms added them fifteen years ago and just haven’t bothered to remove them yet. And it’s blog posts that we’re interested in here – so we’re still in with a chance of building something useful.

And that’s what I did over lunch. I give you Planet Perl, a new site for aggregating Perl blogs.

Currently, it only has four blogs in the configuration. But the config file is on Github and I’ll be happy to get pull requests adding other blogs.

I hope you find it useful.

Categories
Miscellaneous

Blogging for Perl

I think it was at YAPC Copenhagen in 2008 that a small group of us first discussed the idea of building a shared blogging platform for the Perl community. It was over a year later that we launched blogs.perl.org.

I remember a lot of discussions over that time where we tried to thrash out exactly what we wanted to build. I know that one of my main drivers was that I wanted to replace the journals feature of use.perl. For those of you too young to remember, use.perl was a Perl community web site from the dawn of time. The site ran Perl news on its front page, but users could also have their own journal. For a few years, we had a nice little blogging community on the site. It used the same software as Slashdot and, like Slashdot, was looking pretty dated at the time. I remember being particularly disappointed that you couldn’t put images in a journal entry.

So that was certainly where I started from when planning blogs.perl.org. I wanted a modern blogging platform to replace use.perl. Other people wanted slightly different things. At least one person argued strongly that what we really needed was a nice-looking blog aggregator and that people could do their actual blogging on their own sites (or some other blog provider).

But, as you can see, that point of view lost out and we implemented a full blogging system using Movable Type.

Ten years on, I think that was a mistake. I think that having a community blogging platform for Perl is actively harmful to Perl.

I’ll explain why a bit later, but first let’s talk through a bit of more recent history of the site.

It’s well-known, I think, that the site is not is a good state. I’m happy to explain what happened there, but it’s a long and rather dull story. There have been a couple of attempts to build replacement systems but they both stalled before they were complete.

So we’re left in a situation where the site is broken and no-one really has the time or the expertise to fix it. And attempts to replace it seem doomed to failure.

Earlier this year I decided that the situation was untenable and that I wanted to close the site down. I spoke to Aaron and he pretty much agreed with me. We decided that we’d give people plenty of notice to take their blogging elsewhere and, rather than closing the site completely, we would make it read-only (so all the existing content would still be there). We ran the idea past the rest of the loose “management team” and Aristotle spoke up, saying that he would rather take the site over himself and try to improve matters. And that’s what happened. Over the last few months, Aaron and I have extricated ourselves from running the site and it’s all now handled by Aristotle.

I wish him all the best in those endeavours and really hope he manages to make the site better than it was (he’s already making great progress in removing loads of old spam blogs from the site).

But, really, I think that my original plan was a better idea. I don’t want people to blog about Perl on a Perl community site. I want people to blog about Perl on sites where people blog about other languages and technologies.

I’ve been giving talks about the need for the Perl community to break out of its echo chamber for almost as long as I’ve been part of the community. But I think it’s important. It’s a kind of low-key marketing. If you’re talking about your cool Perl project on a Perl community web site then only people who are looking for Perl articles will find it. But if you blog about it on a general programming web site then a) you’ll get a far bigger audience and b) some of that audience might say “oh! I never knew Perl could do that – perhaps I’ll give it a closer look.”

And that’s why I think blogs.perl.org (and, probably, use.perl before it) are harmful to Perl. It encourages Perl bloggers to blog for the Perl community – when it would be far better to get your blog posts in front of more people. Perl people will still read your Perl posts (through Perlsphere perhaps, or post the link to /r/perl or the Perl Community Facebook group) but other people will see them too. On blogs.perl.org, you’re pretty much guaranteed that only Perl programmers will see your posts.

To be honest, I don’t understand why people still use blogs.perl.org. Until Aristotle’s work bears fruit it’s painfully broken. What do you get that’s worth putting yourself through all of that pain? Why not just blog somewhere else and submit your web feed to Perlsphere? Or blog where other programmers blog – somewhere like dev.to, perhaps (I’ve started publishing my more technical blog posts there).

I think it will be great if Aristotle gets blogs.perl.org working well. I really want that to happen. But it would be even better if he didn’t have to. If people stopped using it; if they went off and started spreading their interesting Perl blog posts all over the web.

Break out of the echo chamber. Find yourself a bigger audience. Spread the word beyond the Perl community.

Or, alternatively, explain to me why it’s so vital that the Perl community has its own centralised blogging platform.

Categories
Miscellaneous

The Best of Perl Hacks

What do you do when you’re stuck inside because Coronavirus means that your country is in lockdown? Well, you write a book, of course. Or, to be more accurate, you cobble together fifty or so old blog posts into a book.

So that’s what I’ve done. Now you can read some of your favourite Perl Hacks blog posts in a handy Kindle book. Other ebook marketplaces are, of course, available – but I haven’t had the time to make a version that’s available from anywhere else yet. That might follow if enough people ask for it.

The book is, predictably, called The Best of Perl Hacks and it’s available from Amazon now (that link goes to the UK store, but it should be available on all Amazon sites).

Please buy it, read it and let me know what you think.

Categories
Conferences

PerlCon Europe 2019

Last week I was in Riga for this year’s European PerlCon (the conference formerly known as YAPC::Europe). As has become traditional, here’s my report of the conference.

My conference began on Tuesday night at the pre-conference meet-up. Most people get into town on the night before the conference starts and the organisers always designate a local bar as a meeting place. This time, as the conference was being held in a hotel, the meeting place was a room in the hotel just outside the main conference room. It’s always good to meet up with friends who you might not have seen since the previous conference and I spent a pleasant hour or two, chatting to people before wandering back over the river to the hotel where I was staying before the conference started. As I walked back over the bridge, I could hear the dulcet tones of Rammstein playing a gig about 4km downstream.

The first day of the conference proper was slightly complicated by the need to check out of one hotel and into another. Effectively, it meant that I spent a lot of the day without a room – which was slightly annoying.

The first keynote was Sawyer X talking about The past, the present, and one possible future of Perl 5. From talking to other people afterwards, I think most of the audience was as impressed by his vision as I was. I particularly look forward to hearing more about his plans to engage more companies in the development of Perl. I think that is a great idea.

Following a coffee break, I saw Thomas Klausner talking about Deploying Perl Apps using Docker, Gitlab & Kubernetes. This is a particular area of interest to me currently and it was interesting to see his take on it. I followed that by watching Mohammad Anwar encouraging people to start contributing to CPAN.

After lunch, I took a brief break from the conference (I guess that’s a benefit to knowing that the videoing of the talks is in really capable hands!) I returned in time to see Kenichi Ishigaki describing Recent PAUSE Changes. Because the overall UI of the site has barely changed, I had failed to spot the wholesale changes that have been taking place behind the scenes. It was interesting to be brought up to date.

After the coffee break, I saw Curtis Poe’s talk on Testing Lies. The big takeaway from that seems to be to never trust anyone who claims that something is “always true”.

Then came the first set of lightning talks. As usual, it was a wide-ranging selection including me talking about my Apollo 11 Twitterbot. I particularly enjoyed Job’s amusing walk down memory lane.

After the conference ended for the day there was a new (as far as I know) experiment for a Perl conference – a cocktail party for people who had bought specific kinds of tickets. I had been invited and went along, only to be slightly surprised to find that the drinks selection didn’t include cocktails. I was further surprised to bump into someone who I used to work with back in 2004 and we spent most of the evening catching up.

The second day started with Liz Mattijsen’s keynote DeMythifying Perl 6. I was surprised when she stated that “Perl 6 has damaged Perl 5” was not a myth, but a fact and was totally blown away when she followed that up with a proposal to rename Perl 6. I’ve been saying for ten years that the only thing I don’t like about Perl 6 is its name and I’m really excited to see core Perl 6 developers finally agreeing with this. I’ll be following the developments here really closely.

I then watched Hauke Dämpfling’s WebPerl – Run Perl in the Browser! – which was certainly very clever, but I’m not sure how useful it is. Then I gave my first long talk of the conference – Monoliths, Balls of Mud and Silver Bullets. I think it went well. I certainly got some interesting questions after it.

I’m not really sure what happened after lunch. I think I went back to my room for a bit of lie down and the next thing I knew it was time for the second day of lightning talks. Before that, there were presentations by the two teams vying to organise next years conference (in either Amsterdam or Limassol) and then this year’s attendees got to vote to choose the winner (that’s what’s going on in the photo above). The winner (by only seven votes) was Amsterdam.

I was slightly embarrassed when Lee Johnson mentioned in his lightning talk that my amazing(!) SEO work for last year’s conference meant that Google still thinks all Perl conferences take place in Glasgow – I should probably work out how to fix that! Best of this set of lightning talks was Mark Keating’s adaptation of Dr. Seuss’s “The Sneetches”.

That evening, the attendees’ dinner took place. This was at the same beer hall that the same event took place at the last time the conference was in Riga. Much buffet was had and a lot of beer was drunk.

Day three started in a slightly more muted vein (it often does – as the attendees’ dinner is always on the second night). I missed the keynote and only made it in time for Mohammad Anwar’s second talk of the conference. This one was on how to Protect your Perl script from common security issues. I had to skip out before he got to the questions as I needed to set up in another room for my final talk of the conference – Measuring the Quality of your Perl Code. I was rather (pleasantly) surprised to see the room was completely full and people seemed to find it useful and interesting.

I took the afternoon easy again. I saw Robert Acock on Progressive Web Applications (something else, I really want to get to know about – and I have the feeling it’s not as complicated as my brain seems to want to make it) and Mallory on Designing and Coding for Low Vision.

Then it was time for the final set of lightning talks. It was great to see Thomas re-running his Acme::ReturnValues talk from 2008 (in celebration of the fact that this was the 20th European Perl Conference).

And then it was over. Andrew Shitov, the organiser, thanked all the helpers, speakers and sponsors. And then some of us went off on a cruise on the river.

Categories
Programming

Counting Weekends and Wrapping Text

I said that I probably wouldn’t have time to get involved with the Perl Weekly Challenge every week and that has, unfortunately, proven to be the case. But I had a few free minutes earlier in the week so I decided to look at this week’s challenges. I’m glad I did because they seemed to fit the way my brain works pretty well and I had solutions written rather quickly.

Challenge 1: Write a script to display months from the year 1900 to 2019 where you find 5 weekends i.e. 5 Friday, 5 Saturday and 5 Sunday.

This would be simple enough to just brute-force. But when I started to think about it, I realised there’s a bit of a trick we can use which can cut down our search space quite significantly.

If we’re looking for a month with five Fridays, Saturdays and Sundays then we need a month with 31 days (as four weeks is twenty-eight days and we need three extra days). Only seven months ever have 31 days – January, March, May, July, August, October and December. There is no point at all in ever looking in any other month. You might also realise that those three extra days need to be Friday 29th, Saturday 30th and Sunday 31st. And that means that the first day of the month also needs to be a Friday.

So, the problem simplifies to “Find months with 31 days where the 1st is a Friday”. And here’s the code I wrote to do that:

I’ve seen a few other solutions published and people seem to split into one group who spotted the shortcuts and another who didn’t. But the actual solutions seem very similar. Some people used DateTime instead of Time::Piece and others used low-level functions like timelocal().

Challenge 2: Write a script that can wrap the given paragraph at a specified column using the greedy algorithm.

Honestly, I didn’t think very hard about this at all. I just read the Wikipedia description of the algorithm and wrote a pretty much word-for-word Perl translation of that.

Next week is all about the European Perl Conference so I very much doubt if I’ll have time to try the Perl Weekly Challenges. But I hope to be able to try more of the problems in the coming weeks.