Finishing off the spring cleaning

| No Comments | No TrackBacks
Before I start off on some new Perl posts, I thought I'd write about some of the useful things I came across when doing a spring clean of my disks. I decided it was about time to clean out all my old disks, backups, folders, etc, into a nice ordered filing system. I ended up with 2 root folders, one for work and another for personal stuff. At the same time I upgraded my PCs and laptop to be quad core and use Windows 7.

Firstly a warning, there are some very well made counterfeit copies of Windows 7, hollograms and all. Unless you have a genuine copy of compare them side by side, it's easy to buy a fake. Unfortunately I did :( Here is my post to Microsoft about it.

Some of my personal files I wanted to keep private, I searched for open source options and ended up using AESCrypt. There was another interesting one that created an encrypted drive, but for now I'm happy to put files in a zip and encrypt that file.

First Perl 6 experiences part 2

| No Comments | No TrackBacks
First Perl 6 experiences part 2

When I first looked at this Sunday night I promised myself I'd spend no more than an hour or two on it. Well that went right out of the window :/

My initial aim was to get it working on Vista and run as CGI on IIS. This didn't work. I've spent the last 3 days playing about with it and testing out a load of things to find out why. Eventually with the help of the good people on IRC #perl6 and #parrot we found the problem and came up with a fix. Here are some of the details...

Following on from my last post, the people of the perl6-compiler@perl.org mailing list pointed me to a Rakudo build fix so I was able to build perl.exe by running mingw32-make. This has now been patched into Rakudo on github so if you are following this you shouldn't have the issue I had.

Playing with Rakudo on the command prompt I made my first hello world script 'saved as hello.p6':-

#!c:/temp/rakudo/perl6.exe
say( 'hello' );

And ran it with 'perl6 hello.p6'.

Following that I prepared a version for CGI that included the content-type header:-

#!c:/temp/rakudo/perl6.exe
say( "Content-Type: text/html\r\n\r" ); # say adds the last \n
say( 'hello' );

I checked this on the command prompt to make sure it was outputting properly and it was. Now to setup with IIS.

First Perl 6 experiences

| No Comments | No TrackBacks
First Perl 6 experiences


Ok. I've been telling myself I can look at Perl 6 after I've finished my big project... But I just can't wait. I'm going to have a go at installing it on my Vista 32 laptop, and getting it working through CGI with IIS7.

Getting Rakudo

The Rakudo site has an easy looking guide.

I'm still very new to git, so rather than faf about trying to remember how to use it, I'm just going to download the tarball from:-
http://github.com/rakudo/rakudo/tree/master

Unzipped it to c:\temp and renamed the long rakudo-rakudo-xxxxxxxxx folder to just 'rakudo'.

cd c:\temp\rakudo
perl Configure.pl --gen-parrot

Error:
Generating Parrot ...
C:\Perl\bin\perl.exe build/gen_parrot.pl

The system cannot find the path specified.
Checking out Parrot r37869 via svn...
'svn' is not recognized as an internal or external command,
operable program or batch file.

Perl patching experiences part 2

| No Comments | No TrackBacks
Perl patching experiences part 2

Success with patching Email::Stuff! I saw that it was a part of the Perl Email Project. I got in touch with them about the Email::Stuff bug on their mailing list then followed up on IRC (irc.perl.org #email).
  Ricardo SIGNES was good enough to help me investigate if this was an issue with Email::Stuff or one of the underlying Email::modules. He confirmed this was a stuff issue, and also pointed out a couple of other bugs.
  I offered to supply patches to fix all these bugs. RJBS pulled Email::Stuff into github and gave me a fork to work on (which for me also meant getting a github account and learning the basics of git). A few hours later I had a fully working fork fixing the header loss issue, unused clone issue, and also multipart/alternative issue. I went further to write unit tests to check that these were working properly and ensure they continued to do so in the future. I also updated the docs a little, although I should probably have documented the new conforming functionality a bit more.
  With the minor patch I submitted to Params::Util getting applied but giving me no mention in the changelog. This time I was very chuffed to see my name appear in the credits :)

Patched Email::Stuff 2.07 now on cpan ;)

Clone issue fixed, RT BUG fixed and other problems Ricardo found all fixed.


Lyle

Perl patching experiences part 1

| No Comments | No TrackBacks
Perl patching experiences part 1

Recently I looked at submitting code fixes and posted a quick guide. Since that post I managed to find and fix a bug in Params::Util, submitting the appropriate patch. Adam Kennedy (the maintainer of the module) took it further to write the appropriate unit tests to make sure the problem never came about again.

This has made me realize that patches can be more than just code and typo fixes. An ideal patch would include code fix, unit tests for the problem and possibly documentation updates. It could even be code replacement, or alternative versions.

Writing a CPAN Task

| No Comments | No TrackBacks
Writing a CPAN Task

Last week I was looking into CPAN Bundles and created my first Bundle for the PerlCertifiedHosting project. As a follow up this week I'll create a Task, which is the successor to Bundle.

After listing a load of CGI::Application modules in my Bundle::CertHost it seems it would make a lot of sense if CGI::Application had it's own Bundle or Task that I could just link to.

http://search.cpan.org/dist/Task/lib/Task.pm

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:-
http://search.cpan.org/dist/CPAN/lib/CPAN.pm#Bundles
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:-
http://search.cpan.org/dist/CGI-Kwiki
(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...


Lyle