From: Dave Mitchell Date: Mon, 29 May 2006 14:12:13 +0000 (+0000) Subject: ensure failure to load Carp::Heavy gets reported X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=090656d2188162bd37e6423633fb806b30c6408b;p=p5sagit%2Fp5-mst-13.2.git ensure failure to load Carp::Heavy gets reported p4raw-id: //depot/perl@28330 --- diff --git a/lib/Carp.pm b/lib/Carp.pm index c0ffb9c..5545c39 100644 --- a/lib/Carp.pm +++ b/lib/Carp.pm @@ -28,8 +28,18 @@ sub export_fail { shift; $Verbose = shift if $_[0] eq 'verbose'; @_ } sub longmess { goto &longmess_jmp } sub shortmess { goto &shortmess_jmp } # these two are replaced when Carp::Heavy is loaded -sub longmess_jmp {{ local($@, $!); require Carp::Heavy} goto &longmess_jmp} -sub shortmess_jmp {{ local($@, $!); require Carp::Heavy} goto &shortmess_jmp} +sub longmess_jmp { + local($@, $!); + eval { require Carp::Heavy }; + return $@ if $@; + goto &longmess_jmp; +} +sub shortmess_jmp { + local($@, $!); + eval { require Carp::Heavy }; + return $@ if $@; + goto &shortmess_jmp; +} sub croak { die shortmess @_ } sub confess { die longmess @_ }