Use block eval
Perl> sub thatDies{ die "Kamakazi\n"; };; Perl> print "Test failed with $@\n" unless eval{ thatDies() };; Test failed with Kamakazi
In reply to Re: testing a croak
by BrowserUk
in thread testing a croak
by arcnon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |