Skip to content

Categories:
  • Admin
  • Articles
  • Books
  • Community
  • Conferences
  • CPAN
  • London.pm
  • Marketing
  • Programming
  • Speaking
  • Training
  • Weirdness

Texinfo 5.0 in Perl

There was a story on Slashdot on Sunday saying that the new version of Texinfo had replaced the old, C, implementation of makeinfo with one written in Perl.

I thought it would be interesting to look at the Perl they’ve written. This is, after all, a reasonably large example of Perl code that will be getting a bit of attention in the open source[1] world. If you want to look too, you can download the tarball or browse the CVS repository. In both cases, the Perl code is in the directory called ‘tp’.

This first thing to note is that this is obviously code which has been written by programmers who know their craft. This has not been written by script kiddies. There are, however, some rather bizarre touches which imply that the authors don’t know Perl as well as they might hope.

  • The code is nicely partitioned into modules. And many of the modules are really classes. But some of the modules (the ones in the init directory) have no package statement. So they are more like Perl4-style libraries than what we’d recognise as modules.
  • Many (in fact it might be all) of the subroutines in the modules have prototypes. In many cases, that doesn’t do any harm (although Perl prototypes don’t really address the issues that most people assume they address). But many of these subroutines are called as methods. And prototypes have no effect on method calls at all.
  • There is rather more use of package variables (instead of lexical variables) than I’d be comfortable using in my code.
  • I can see no use of CPAN modules. Perhaps there are no CPAN modules that help with this code. But I’d find that surprising in a project of this size.

Then I started to wonder which version of Perl they were targetting. So I searched for “use 5.xxx” statements. And found quite a range. Many of the files insist on 5.006 and most of the rest want 5.00405 – which I consider a scarily old version of Perl to try and support. There was one file that wanted 5.007_003. Then in one file (Texinfo::Parser) I found this:

# We need the unicode stuff.
use 5.006;

Reading the original Slashdot story, it claimed that one of the improvements in this new version was its Unicode support. And suggesting that you need Perl 5.006 for decent Unicode shows some major misunderstanding. Perl 5.006 was probably the point at which the Perl 5 Porters started to take Unicode seriously. It took until 5.12 or 5.14 before they got it right. Trying to support Unicode properly on anything earlier is almost certainly doomed to failure.

It’s great that another heavily-used project has started to use Perl. But it’s a shame that people might mistake this 5.6-era code for state of the art Perl. I can’t help wondering if this is a symptom of the “Perl 5 can’t have a new version number” problem that I’ve been reading about recently

I’ll get in touch with the Texinfo team and make some suggestions to them, of course.

Update: I emailed the Texinfo mailing list with a link to this blog post. I got a reply from Patrick Dumas who wrote most of this Perl code. His reply is available on the mailing list archives.

[1] Sorry, it’s a GNU project so obviously I mean “free”, not “open source”.

  • spacer Bookmark on Delicious
  • spacer Digg this post
  • spacer Share on Facebook
  • spacer share via Reddit
  • spacer Tumblr it
  • spacer Subscribe to the comments on this post
  • spacer Print for later
  • spacer Bookmark in Browser
  • spacer Tell a friend

Posted in Programming.

Tagged with perl. programming, texinfo.

No comments

By Dave Cross February 19, 2013


Training Cancelled

A few weeks ago, I mentioned that I had two days of public training coming up in Manchester in April. I’ve just heard that the organisers have decided to cancel this training as they have had no bookings for the classes. I’m sorry if anyone was planning to book closer to the date and has been inconvenienced by this.

  • spacer Bookmark on Delicious
  • spacer Digg this post
  • spacer Share on Facebook
  • spacer share via Reddit
  • spacer Tumblr it
  • spacer Subscribe to the comments on this post
  • spacer Print for later
  • spacer Bookmark in Browser
  • spacer Tell a friend

Posted in Training.

Tagged with manchester, perl, training.

No comments

By Dave Cross February 18, 2013


Training Debrief

I’ve spent a lot of the last seven days running training courses. It might be interesting to share some thoughts about how they went.

Last Saturday was Perl School 4. A week before the course I was a little worried about ticket sales, but I did a bit of marketing early last week and managed to more than double sales in a few days. In the end I had 27 people signed up.

Perl School is always enjoyable. I think that people often turn up with quite low expectations as it’s so cheap. So it’s fun to overturn those expectations and give them a day of high quality training. People obviously recognise that as I’m getting a lot of repeat business – at least one person has come along to three of the four courses so far.

Many of the courses I give are overviews of Perl at various levels. This one was just about DBIx::Class so it was great to be able to go into a lot more depth on a single topic. Of course, DBIx::Class is a great subject to cover and it was fun explaining its more powerful corners to a room of people who don’t know much about it.

I thought it went well. But don’t just take my word for it. I’ve been asking attendees to fill in feedback forms about all the Perl School courses and I’ve published a page summarising that feedback.

Then this week has been two two-day courses for flossUK. Two day courses give us time to include practical sessions so that people go home having actually tried out the techniques that I’ve taught – which nicely reinforces the lessons. I really enjoy those sessions as you really see lightbulb moments as people see how easy it is to use these tools. This afternoon, for example, it was great to see people getting a simple Catalyst application up and running in less than an hour. An hour later people were really impressed as I introduced them to Plack::Middleware::Debug and showed them how I could get detailed DBIC_TRACE output on the web page by making tiny changes to the application code. At least one person went away determined to reimplement a number of key applications in Catalyst as soon as possible.

And that, to me, is the joy of running training courses. It’s great to open people’s eyes to the possibilities that these new tools give them. I love to see them leave filled with renewed enthusiasm for the language.

  • spacer Bookmark on Delicious
  • spacer Digg this post
  • spacer Share on Facebook
  • spacer share via Reddit
  • spacer Tumblr it
  • spacer Subscribe to the comments on this post
  • spacer Print for later
  • spacer Bookmark in Browser
  • spacer Tell a friend

Posted in Training.

Tagged with flossuk, perl, perl school, training.

No comments

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.