Varnish and Attributes

davorg on 2001-12-10T08:49:27

It was a weekend of two halves. In the real world, we decided that it was finally time to varnish and seal the wooden floors that were laid in the kitchen and bathroom over six months ago. This involved much moving around of stuff, visits to DIY stores to get the relevant equipment and a horrible solvent smell filling the house for all of Sunday.

In the virtual world it was largely a case of finding lots of little things to do to put off having to write my "Idiotic Perl" talk for the German Perl Workshop. On Saturday afternoon I took a look at muttley's WWW::Amazon::Wishlist module and sent him a couple of patches. On Sunday I took a closer look at Attribute::Handlers, in particular the autotie method for simplifying the tie mechanism. I changed Tie::Hash::Regex, Tie::Hash::FixedKeys and Tie::Hash::Cannabinol to support this interface. Now instead of doing something like:

use Tie::Hash::Regex;
my %hash;
tie %hash, 'Tie::Hash::Regex';

You can just use:

use Tie::Hash::Regex;
my %hash : Regex;

Similarly for the others...

use Tie::Hash::FixedKeys;
my %hash : FixedKeys (qw/a list of valid keys/);

And (my favourite):

use Tie::Hash::Cannabinol;
my %hash : Stoned;

Oh, and I converted all of my test scripts to use Test::Simple - It really does make writing test scripts so much easier.