Subject: | avoid warning on ->VERSION() |
I use the Dist::Zilla::Plugin::ReportVersions.
It inject the t/000-report-versions.t into the Dizt::Zilla build of the
perl module
The t/000-report-versions.t contains:
require_ok $module or BAIL_OUT("can't load $module");
my $version = $module->VERSION;
thus calling the Modern::Perl->VERSION without arguments. This generates
the warning:
Modern::Perl: Use of uninitialized value $version in numeric lt (<)
at Modern/Perl.pm
The patch supplied solves the problem.
Subject: | Modern-Perl-sub-VERSION-nowarn.patch |
--- Modern/Perl.pm.orig 2012-10-20 22:55:13.000000000 +0400
+++ Modern/Perl.pm 2012-10-20 23:01:18.000000000 +0400
@@ -22,7 +22,7 @@
sub VERSION
{
my ($self, $version) = @_;
- return $VERSION if $version < 2009;
+ return $VERSION if not( defined $version ) or $version < 2009;
$wanted_date = $version if (caller(1))[3] =~ /::BEGIN/;
return 2012;