Sam's Blog
Welcome to Sam's Blog, my imaginatively-named blog on programming in the Perl programming language and whatever else takes my fancy.
This blog is happy to be part of the Perl Iron Man Challenge.
Recent Entries
Setting your repository in META.yml with Module::Build
Date: Thursday, 3 January 2013, 14:49.
Categories: perl, ironman, module-authoring, module-build.
I've apparently had this blog sat in my out-bound queue since September 2010 and completely forgot to publish it. Meanwhile over on Perl 5 Maven, Gabor Szabo has raised the subject with his "How to convince Meta CPAN to show a link to the version control system of a distribution?" article.
Edit: turns out I'd left it unpublished for a reason, the sample code was actually broken. Just go and read Gabor's article instead - and thank him for testing my broken code! I've removed the broken code from the article below.
Whilst I was making some changes to Template::Sandbox
and Template::Benchmark as part of my move to using
git
and GitHub, I noticed
that there wasn't any documentation on how to set your source code
respository for the META.yml when using Module::Build.
I thought a quick how-to would be handy.
Review: Sword of the Stars II Enhanced Edition
Date: Tuesday, 11 December 2012, 15:37.
Categories: games, review, game-review, sword-of-the-stars, 4x, strategy.
The initial release of Sword of the Stars II was possibly the most shambolic release of a game I have ever seen, it made Master of Orion 3 look like a masterpiece of finished product.
A year on, and free to people who didn't take up the refund offer on the original, the Enhanced Edition finally shows what Sword of the Stars II should have been on release - a worthy successor to the ground-breaking original. It took them a while, but they got there in the end.
There's still a few rough edges, and some of the easy accessibility of the original is gone, but the sequel shows that they're still willing to challenge some of the design conventions that 4X games all-too-often find themselves blindly defaulting to.
Showing my Ol***ics(tm)-induced patriotic fervour with this warning on the perils of "Thing, Prefix of" notation, courtesy of speedtest.net:

Shell-quoting future me, printf -v "%q" is what you're looking for
Date: Friday, 15 June 2012, 12:59.
Categories: bash, shell-scripting, note-to-future-me.
Note to future me: Are you trying to remember how to shell-quote/escape the contents of a variable to avoid going utterly insane from the nested double-quotes and backslashing?
printf -v escaped_var "%q" "$var"
is the command
that you can never remember, and never find the documentation
for until you've wasted a morning of your life.
Don't forget it next time. Or at least, remember that you wrote this note, kthxbai.
Bash-itunes plugin tutorial
Date: Friday, 15 June 2012, 11:03.
Categories: bash-itunes, itunes, cli, bash, shell-scripting, apple-script, tutorial.
In v1.2.0 of bash-itunes, my project to control iTunes from the command-line, I've added plugin support for sub-commands.
This allows you, or anyone else, to add new commands to the basic script without needing to alter the script itself.
Read below the cut for details and a walkthrough of creating a new plugin.