---some.t--- use Test::More tests => 2; use Error ':try'; use_ok('MyModule'); try { MyModule->foo('badparam'); } catch with MyModule::Exception { pass; } otherwise { fail; }