Oh brilliant - thanks Dave. I spent about 20 mins hunting through the code for something resembling the "-array" parameter in the error message and couldn't see anything helpful at all!
It looks as if I am going to have some fun thrashing through all this code. I think I'd better download and install HEAD before I do much more.