Perl 6 - The road to helping with development

by Lyle Hopkins

I decided that I'd had enough. I wanted to use Perl 6, I wanted it fully released and I wanted all the world to be looking at it and saying "WoW, for Perl 6 is the Kwisatz Haderach!". I wanted it now... But it isn't ready now. So I weighed up my options...

A) Scream and shout at the Perl 6 Porters to get a move on

This would not help at all and do nothing but piss a load of people off

B) Give loads of money to TPF and ask them nicely to spend it on increasing production speed

This may well help, but with 1 major draw back, I don't have loads of money :(

C) Get up off my ass and contribute to Perl 6 development

This seems like something I might be capable of

D) Try and get more people involved in Perl 6 development

I could have a go at this, but I don't think people are going to listen much if I'm not involved myself

Hmmm, A) is out of the question and B) is also out of the question, unless I win the lottery (which I don't play) or business really takes off (fingers crossed). So It looks like C) and D) are my only options. Well I've I'm working toward C) then I could write a guide as to my experience then I could use that guide for D). Brilliant! Hence this document.

Ok, where to start. Well my Perl knowledge is going to have to get a lot better, and as Perl 5, 6 and Parrot are coded in C then I'm going to have to learn (or re-learn) C. Better Perl knowledge

I've been coding Perl for almost 10 years now. My Perl has improved greatly over the years learning from examples, various Perl books and pestering the PerlMonks. Good knowledge, but not great knowledge. Time to fill in all the gaps. First some heavy reading, books:-

  • Learning Perl
  • Intermediate Perl
  • Perl Best Practice
  • Advanced Perl Programming (1st Edition)
  • Mastering Perl

Roughly in that order. I actually bought and read a load more, but I think that these are the core ones you'll want to have read for this purpose. I also joined London Perl Moungers (refered to herein as LPM), now pestering them (and still PerlMonks, where you can often catch the Authors of these books) to fill in any gaps or niggles that had been pestering me. When I joined a Perl group near me, Bath Perl Moungers I found that their leader had moved nearer London and meets were no longer happening, in fact my post to the list in September was the first that year! Yikes! Within a month the old leader transfered the list to me and I also restarted Bristol Perl Moungers which had died 2 years previous, running both lists together as Bristol and Bath Perl Moungers.

I also opened a PAUSE account at CPAN and started contributing Perl module I thought others wanted or would find useful. Learning C

Having quickly gained much respect for the opinions of the LPM (well, most of them anyway :P) I asked them as to which books would be best to learn C. Kernighan and Ritchie's The C Programming Language was by far the most recommended book, second was Tartan Labs C: A Refence Manual. For XS programming (extending Perl with C code and libraries) the books Advanced Perl (first Edition) and Extending and Embedding Perl both by Simon Cozens. Also recommended was simply printing off the perldoc for XS, starting with perlxstut. You can usually catch Simon at the LPM which is certainly useful.

I haven't got through the C books yet, so I'll update this section once I have. Knowing the setup

I got in touch with chromatic one of main developers of Perl 6 and asked a few questions.

Lyle -"What knowledge will I need to know so that I can make useful code updates and patches?"

Chromatic - "How to use Subversion or SVK, how to read diffs, how to use RT at a basic level. Beyond that, general knowledge of Perl modules should be fine. Browsing the Synopses at will help too."

Subversion and SVK? At first I had no idea what they were, but once I read up I was excited! Having had a look at CVS about a month previous I wasn't that impressed. But Subversion and SVK looked great, their documentation looked much, much better. Time to get learning. Subversion host subversion (along with a lot of other cool stuff) I also found subtrain on there which looked like it'll be all I need to learn this. Let's get this installed and working, then have a play about with it. Unfortunately there is a bit of a problem, although all my hosting servers are Linux, my local desktops and servers are Windows (don't blame me, blame Adobe Photoshop and Dreamweaver). Only the subversion client works on Windows so I'll have to install Apache. I downloaded a copy of Apache 2.2.6 (binary) and subverion 1.4.5 (binarys in zip) also the Perl 5.8 subversion bindings (mobules zip). Installing Apache

Having IIS running, I wanted to put Apache on port 8080. Although the MSI had options for either port 80 as a service or port 8080 as a manual start. Not wanting to go to the effort of setting up a service later, I selected port 80, then once installed (gave me error when it tried to start) updated httpd.conf to use port 8080 and restarted the server. Bingo, opening http://localhost:8080/ in my browser gave me "It works!". Installing Subversion

Opening the zip, the README.txt points me to INSTALL. I unzipped and moved the svn files to c:\Program Files (x86)\Subversion. I then updated my PATH environment variables to include c:\Program Files (x86)\Subversion\bin (in Vista Control Panel->System and Maintenance->System->Advanced Settings->Environment Variables). I tested with the command prompt "C:\temp>svn co svn" worked fine. I unzipped the Perl bindings modules, and copied them to the appropriate ActivePerl folders (C:\perl). Learning Subversion

I downloaded subtrain and started working through the material. The presentations were very helpful, allowing me to work my way through setting up Apache and a repository. I've included my findings in these sections. From having a quick look at SVK it appears that I'll only need Subversion to create a repository, the SVK will do the rest. Linking Subversion with Apache

I copied the files and from c:\Program Files (x86)\Subversion\bin to c:\Program Files (x86)\Apache Software Foundation\Apache2.2\modules. I updated httpd.conf, adding the following lines to the bottom of the LoadModule list:-

LoadModule dav_svn_module modules/
LoadModule authz_svn_module modules/

I also uncommented the line:-

LoadModule dav_module modules/

Then to the very bottom of httpd.conf I added:-

<Location /svn>
DAV svn
SVNPath "c:/Software/Development/Repository"
AuthType Basic
AuthName "Authentication Realm"
AuthUserFile "c:/Software/Development/Repository/.htpasswd"
AuthzSVNAccessFile "c:/Software/Development/Repository/accessfile"
Require valid-user

I restarted Apache and it seemed quite happy. I tested http://localhost:8080/svn, got authentication required as I expected, as I hadn't setup a user I hit cancel. So I created the .htpasswd file and input the username:password I got from a site on the net. Didn't work. I found another site with an online generator that gave me some different text, tried that, didn't work. So i setup one of my scripts to generate users for .htpasswd... Still didn't work. At this point I'm thinking this is probably a Win32 issues, after a search I learned on htpasswd.exe which I found in c:\Program Files (x86)\Subversion\bin to c:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin. So I changed to that directory, and ran:-

htpasswd -b c:/Software/Development/Repository/.htpasswd test test

This created the correct login for me, when I tried http://localhost:8080/svn it worked. Note to self, update my .htpasswd script to create the correct Win32 password encryption. Creating my repository

Opened a command prompt and typed:-

svnadmin create "c:/software/development/repository"

Worked like a charm :) I didn't import any of my projects at this stage as some of them are embarrasingly messy so I'd like to clean them up a bit before putting them in. SVK

SVK is now owned by Best Practical, probably the best thing about it is that it is coded in Perl :) I downloaded and installed the SVK 2.0.2 binary. All pretty straight forward.

svk mirror http://192.168.1.X/8080/svn //mirror/repo

Change Colour