I wrote a CPAN module back in the day. Let's not talk about it; it wasn't very good. Recently the local Perlmongers group (ThamesValley.pm) encouraged me to modularise and release some newer code.

I chose to work on my OpenStreetMap plotter: given boundary latitudes and longitudes, it downloads OpenStreetMap tiles, crops to the right size, and provides utility functions so that you can translate lat/long coordinates of markers to pixel coordinates on the image. It's tightly tied to Imager, which at this point is clearly the best raster-image plotting module for Perl, though surprisingly under-used. The result is not a slippy map as you'd see on the OpenStreetMap site, just a static image; I wrote the code first for my beerdiary mapped reviews microsite, and amended it extensively when I got a GPS receiver and wanted to plot tracks from that.

(It was much easier when Google Maps allowed one to view KML files without having an account. But they weren't getting enough personal data from that, so they stopped.)

While one can still do the packaging process with basic commands and hand editing, the cool kids now automate it. On NeilB's advice I tried Minilla, which is not packaged in Debian and has an extensive dependency list - which is a slight problem for me, because I like to install CPAN modules as Debian packages using dh-make-perl, and therefore had to run a series of attempted setups, see which tests failed because of missing modules, install them, and repeat the process.

Minilla wants a .pause file to drive the upload process. For the syntax of this, it refers to another piece of documentation - with an incorrect link. What is this, PHP? http://search.cpan.org/~syohex/Minilla-v3.0.10/lib/Minilla.pm#CONFIGURATION refers to http://search.cpan.org/perldoc?cpan_upload#CONFIGURATION which should be http://search.cpan.org/perldoc?cpan-upload#CONFIGURATION - spot the subtle difference! All to save the effort of writing "have a plain text file, the first line being 'user' followed by your username, the second being 'password' followed by your password".

There was also some strangeness with a dummy (non-uploaded) release, and version numbers, which meant that the first release I could upload was v0.02. Hey ho. There's really very little indication of just how the Changes file is supposed to be manipulated…

On the other hand, Minilla did a great job of providing a skeleton module; while rewriting the code to fit better into this format and be more strictly encapsulated, I was able to modify it to remove a final cropping step that had been necessary in previous versions.

So now it's out there. Yay! The only feedback I've had in nearly three months since release is someone telling me I'd left out a dependency.

See the linked blog post below for example output.