What you want to do is try to load the module in the standard Perlish way, trapping exceptions. An eval block will trap exceptions. The messages that these exceptions produce will be in $@. So, try this: