use Test::Simple 'no_plan'; sub throws_ok(&@) { my ($test, $qr, $msg) = @_; eval { shift->() }; ok($@ =~ /$qr/, $msg); } throws_ok { die "blah" } qr/bla/, 'blah blah';