Thanks, that looks good.
I picked up the book Perl Best Practices, which has inspired me to rewrite a lot of the junk that was in my code.
There were a lot of inefficient SQL tests I had that I have now simplified without loops or extra variables.
This change is to make the test for valid...