eval { $obj->method() }; if ($@) { if (my $exception = My::Excpetion::Thingy->caught()) { do_something(); } else { do_the_other_thing(); } }