in reply to testing the exception throwing

I haven't used it, but maybe Test::Exception (and its ilk).