From: matthewt Date: Sun, 5 Dec 2010 18:23:16 +0000 (+0000) Subject: fix warnings, improve author side error X-Git-Tag: release_1.1.1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2Fstrictures.git;a=commitdiff_plain;h=0925b84bafcd23dcf2c61aa19c1557cf1ff937af;hp=83b80b69f149de2f10f123873aecf92aa5350321 fix warnings, improve author side error --- diff --git a/Changes b/Changes index fcefbf8..3f03aa8 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +1.1.1 Dec 05 2010 + - disable uninitialized warnings before calling ->SUPER::VERSION 1.1.0 Nov 22 2010 - enable extra testing only if .git or .svn present to keep requirement for extra modules author-side diff --git a/lib/strictures.pm b/lib/strictures.pm index 63c1af5..976ff13 100644 --- a/lib/strictures.pm +++ b/lib/strictures.pm @@ -3,13 +3,19 @@ package strictures; use strict; use warnings FATAL => 'all'; -our $VERSION = '1.001000'; # 1.1.0 +our $VERSION = '1.001001'; # 1.1.1 sub VERSION { for ($_[1]) { last unless defined && !ref && int != 1; die "Major version specified as $_ - this is strictures version 1"; } + # disable this since Foo->VERSION(undef) correctly returns the version + # and that can happen either if our caller passes undef explicitly or + # because the for above autovivified $_[1] - I could make it stop but + # it's pointless since we don't want to blow up if the caller does + # something valid either. + no warnings 'uninitialized'; shift->SUPER::VERSION(@_); } @@ -28,7 +34,11 @@ sub import { if (eval { require indirect; 1 }) { indirect->unimport(':fatal'); } else { - die "strictures.pm extra testing active but couldn't load indirect.pm: $@"; + die "strictures.pm extra testing active but couldn't load indirect.pm +Extra testing is auto-enabled in checkouts only, so if you're the author +of a strictures using module you should 'cpan indirect' but the module +is not required by your users. +Error loading indirect.pm was: $@"; } } }