Test::Exception.

examples/perl/t/test_exception.t
use strict;
use warnings;

use Test::More tests => 2;
use Test::Exception;

is div(6, 2), 3, 'div by 2';
throws_ok { div(8, 0) } qr/division by zero/, 'div by zero';


sub div {
    my ($x, $y) = @_;
    return $x/$y;
}
1..2
ok 1 - div by 2
ok 2 - div by zero
throws_ok { $foo->method } 'Error::Simple', 'simple error thrown';

Where Error::Simple is the class of the exception that have been thrown. e.g. by Exception::Class.