From: Matt S Trout Date: Fri, 16 Mar 2012 08:48:07 +0000 (+0000) Subject: defatalize lack of extra testing modules X-Git-Tag: v1.003001~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ffedb166dfd9760a9120a2b28c646300b4491bfa;p=p5sagit%2Fstrictures.git defatalize lack of extra testing modules --- diff --git a/Changes b/Changes index 89498d3..9ca6750 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,4 @@ + - defatalize lack of extra testing modules - disable extra tests on perls <= 5.008003, things do not work there as expected 1.002002 - 2011-02-25 diff --git a/lib/strictures.pm b/lib/strictures.pm index 911746d..e7882d6 100644 --- a/lib/strictures.pm +++ b/lib/strictures.pm @@ -21,6 +21,8 @@ sub VERSION { shift->SUPER::VERSION(@_); } +my $extras_load_warned; + sub import { strict->import; warnings->import(FATAL => 'all'); @@ -38,26 +40,35 @@ sub import { } }; if ($extra_tests) { - if (eval { - require indirect; - require multidimensional; - require bareword::filehandles; - 1 - }) { + my @failed; + if (eval { require indirect; 1 }) { indirect->unimport(':fatal'); + } else { + push @failed, 'indirect'; + } + if (eval { require multidimensional; 1 }) { multidimensional->unimport; + } else { + push @failed, 'multidimensional'; + } + if (eval { require bareword::filehandles; 1 }) { bareword::filehandles->unimport; } else { - die <