my $success = eval { SubCall($silly); 1 }; ok !$success && $@ eq $errmsg, 'died with the right error message'; #### my $success = try SubCall($silly); ok $!.defined && $! eq $errmsg, 'died with the right error message';