Subject: | [PATCH] ExtUtils::MakeMaker confused by E::C $VERSION |
ExtUtils::MakeMaker is picking up the \$VERSION line in _make_subclass
and reporting the version of Exception::Class as 1.1. This causes
installation failures with modules (such as Object::InsideOut) that try
to require a minimum version of Exception::Class:
Warning: prerequisite Exception::Class 1.26 not found. We have 1.1.
I realize this is a problem with ExtUtils::MakeMaker, but the "fix" for
Exception::Class is to eliminate the use of 'use var' everywhere. Since
you're now requiring 5.8.1, this should not cause any problems.
The attached patch removes all use of 'use var' in module code and test
code.
Thanks
Subject: | e-c.patch |
diff -urN Exception-Class-1.28/lib/Exception/Class.pm Exception-Class-patched/lib/Exception/Class.pm
--- Exception-Class-1.28/lib/Exception/Class.pm 2009-05-07 07:57:27.799900800 -0400
+++ Exception-Class-patched/lib/Exception/Class.pm 2009-05-07 07:58:44.569548800 -0400
@@ -123,11 +123,9 @@
my $code = <<"EOPERL";
package $subclass;
-use vars qw(\$VERSION);
-
use base qw($isa);
-\$VERSION = '1.1';
+our \$VERSION = '1.1';
1;
diff -urN Exception-Class-1.28/t/basic.t Exception-Class-patched/t/basic.t
--- Exception-Class-1.28/t/basic.t 2009-05-07 07:57:28.018706800 -0400
+++ Exception-Class-patched/t/basic.t 2009-05-07 08:02:05.443109600 -0400
@@ -16,12 +16,10 @@
{
package FooException;
- use vars qw[$VERSION];
-
use Exception::Class;
use base qw(Exception::Class::Base);
- $VERSION = 0.01;
+ our $VERSION = 0.01;
1;
}
@@ -77,7 +75,7 @@
is( $@->file, $expect,
"File should be '$expect'" );
- is( $@->line, 60,
+ is( $@->line, 58,
"Line should be 60" );
is( $@->pid, $$,
diff -urN Exception-Class-1.28/t/ignore.t Exception-Class-patched/t/ignore.t
--- Exception-Class-1.28/t/ignore.t 2009-05-07 07:57:28.112480800 -0400
+++ Exception-Class-patched/t/ignore.t 2009-05-07 08:00:04.885495200 -0400
@@ -25,8 +25,7 @@
package Baz;
-use vars qw(@ISA);
-@ISA = qw(Foo);
+our @ISA = qw(Foo);
sub baz
{