better error handling in cpan script