January 2009 Archives

Writing a CPAN Bundle

| No Comments | No TrackBacks
Writing a CPAN Bundle

I decided to take an hour out from my big project today to make my first CPAN Bundle for the PerlCertifiedHosting Project. Last year I posted to B&BPM asking how this was done as when I looked at bundles on CPAN I couldn't see anything special. David Cantrell was good enough to respond, pointing me to:-
Which explains it. I was looking for some special code or something, when after all it's just a list of modules in the contents section.

First draft:-

How to submit Perl patches?

| No Comments | No TrackBacks
How to submit Perl patches?

It's about time I learnt to submit proper patches. In the past I've just emailed module authors spelling mistakes and code fixes. This isn't good for the authors as then they have to scan through and manually edit the modules themselves. Thus making it more time consuming for them, and less likely for them to apply your fix. The proper way to do with is by supplying a diff which can be patched into the module. I've been sending lots of typo fixes to Mark Stosberg recently as I've been reading up on CGI::Application. I've promised him the next ones I send will be proper patches. Although as it turns out, my first patch wont be for CGI::App typos.

This post is a continuation of my last post, which you'll need to follow for the example to work.

Let's go through the process for the bug I found in the CGI::Kwiki test suite when ran under Windows.

First let look at the current test file (C:\temp\CGI-Kwiki-0.18\t\test.t):-

Building perl modules from source on windows

This guide is to cover building and installing Pure Perl modules on Windows for use with ActivePerl. It doesn't cover XS Perl modules that use C libraries. I'll leave that for another post :)

You'll want UnxUtils from sourceforge and nmake from Microsoft. If you haven't already installed these, follow these steps:-

Taking a look at Kwiki

| No Comments | No TrackBacks
Taking a look at Kwiki

A few months ago I was looking at Perl Wikis. I had a terrible experience trying to get SocialText installed on CentOS and ended up using TWiki for 3 sites.

I was impressed by TWiki, but there are a few things that nag me about it. I don't like having to setup redirects from a would be index.html to /twiki/bin/view/Main/WebHome. My designer has been moaning at me that getting the designs he wants into it is hard. For smaller Wiki's, it does seem a bit like overkill. So what about the other end of the Perl Wiki scale?

I've recently been looking at redesigning a site that uses Kwiki. So let's take a closer look.

Kwiki - "A Quickie Wiki that's not too Tricky"

Well at the moment the Kwiki site seems to be down most the time. Not quite sure what's happening there.
Luckily you can get it on cpan:-
(Make sure you get the old CGI::Kwiki from cpan, and not the new Kwiki distro. You should only download Kwiki from the Kwiki.org site)

I had a quick look on ppm and CGI::Kwiki wasn't there. Having a quick look at CPAN testers I got the feeling it was a problem with the tests rather than Kwiki itself. Which leads me onto my next 2 posts...


Useful firefox search hack

| No Comments | No TrackBacks
Useful Firefox search hack

I read of a really useful Firefox hack the other day which I've been
using an awful lot since. It's saved me a lot of time, but I can't for
the life of me remember where I read about it... I'm sure it was a book
review or something?  :-\

Anyway, in Firefox do:-
Bookmarks->Organise Bookmarks
Then click on 'Bookmarks Menu', right click on the right pane and select
'New Bookmark'.

Call it 'CPAN search', put the location as
'http://search.cpan.org/search?query=%s&mode=all' and most importantly
set the keyword to 'cpan' (This is why we're adding through Organise
Bookmarks rather than just add bookmark).

Now you can easily search cpan. Just type 'cpan MODULE' in the address bar.

You can of course use this same hack for any number of sites that have
the search term in the query string.


Making .po and .mo files

| No Comments | No TrackBacks
Using CGI::Application::Plugin::I18N

Making .po and .mo files.

Now the the module is released to CPAN I've added a i18n guide on how to make .po and .mo files. Here is a cut down version for my blog:-

Creating .po and .mo files

The .po files are the editable language packs. The .mo files are compiled versions that are a bit faster to use.

I've found a good little app for creating .po and .mo files:- http://www.poedit.org It's cross platform and gives you a nice GUI to work from. Of course you can always edit the .po files direct and generate the .mo files yourself.

Packaging CPAN modules from Windows in Linux Style

You're a CPAN author, but against the trend you develop on Windows rather than Linux.
This is fine, helps a lot with your modules cross platform compatibility, but when you come to package your modules for CPAN you hit a snag. Windows doesn't have tar or gzip, or even make... You can get nmake as a download from Microsoft, you could use .zip rather than .tar.gz, but this isn't going to make the Linux buffs very happy.

The solution is pretty simple, luckily there is a package called UnxUtils (yes no i in Unx) available on sourceforge. This has Win32 ports of gzip, tar and make. Although you'll still need nmake from Microsoft as you'll find make won't read windows paths properly.

Here is a quick step by step:-

Giving CGI::Application internationalization (I18N)

Part 4

After a bit of debugging I finally have the first release of the module ready. All the methods are documented, I've done some manual testing but I still need to bulk out all of the automated tests. I also need to writing documenation on how to create the .po and .mo files to use with this, but I've come across a very useful cross platform app called Poedit which makes it a lot easier.

I'm probably over eager to upload this to CPAN, as it's only version 0.01 but I'm keen to get it up.

With a bit of luck I'll have it uploaded tonight. It's also given me some good material for my next post "Packaging CPAN modules from Windows in Linux Style", as I'm having to do this and I've seen this come up in forums from time to time.

Module code below:-


About this Archive

This page is an archive of entries from January 2009 listed from newest to oldest.

December 2008 is the previous archive.

February 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.