use English '-no_match_vars'; eval { possible_exception_thrower() }; ok( ! $EVAL_ERROR, 'possible_exception_thrower() threw nothing' ); eval { this_should_die() }; ok( $EVAL_ERROR, 'this_should_die() did die' ); like( $EVAL_ERROR, qr/exceptional error text/, 'this_should_die() died for the expected reason ); #### { my $warning; local $SIG{__WARN__} = sub { $warning = shift }; is( $warning, undef, 'no warnings recorded' ); code_that_warns(); is( $warning, 'expected warning', 'code_that_warns() does indeed warn' ); $warning = undef; non_warning_code(); is( $warning, undef, 'non_warning_code() is clean' ); }