Skip Menu |
 

This queue is for tickets about the Module-Install CPAN distribution.

Report information
The Basics
Id: 17639
Status: resolved
Priority: 0/
Queue: Module-Install

People
Owner: Nobody in particular
Requestors: shay [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] Module::Install breaks with proxy constant subroutines in perl-5.9.3
Download (untitled) / with headers
text/plain 1018b
Running "perl Makefile.PL" in the attached Foo module (which includes Module-Install-0.56) works fine with perl-5.8.8, but with perl-5.9.3 it dies with the error: Not a GLOB reference at inc/Module/Install.pm line 91. BEGIN failed--compilation aborted at Makefile.PL line 3. The error arises because of the "use constant FOO => 1;" line in inc/Module/Install/PRIVATE.pm -- removing that line fixes it. The reason for this is that perl-5.9.3 introduced "proxy constant subroutines" (see perl593delta.pod) which are not full typeglobs until they are actually used. In the meantime, they are just SCALAR refs, hence the "not a GLOB ref" error. The attached patch fixes the error by eval()'ing the GLOB ref de-reference: if it isn't a GLOB ref then eval() returns undef and the item is ignored. Presumably that's not actually the best idea if the only thing in the extension being pre-loaded is constants, so you may want a better fix than this, but it works OK for extensions containing constants and other methods.
Subject: Foo.tar.gz
Download Foo.tar.gz
application/x-gzip 2.6k

Message body not shown because it is not plain text.

Subject: patch.txt
Download patch.txt
text/plain 635b
diff -ruN Module-Install-0.56.orig/lib/Module/Install.pm Module-Install-0.56/lib/Module/Install.pm --- Module-Install-0.56.orig/lib/Module/Install.pm 2006-02-08 14:04:18.000000000 +0000 +++ Module-Install-0.56/lib/Module/Install.pm 2006-02-14 12:03:33.540377600 +0000 @@ -88,7 +88,7 @@ my %seen_method; foreach my $obj ( @exts ) { while (my ($method, $glob) = each %{ref($obj) . '::'}) { - next unless defined *{$glob}{CODE}; + next unless defined eval { *{$glob}{CODE} }; next if $method =~ /^_/; next if $method eq uc($method); $seen_method{$method}++;
Download (untitled) / with headers
text/plain 142b
I'm not convinced this is a Module::Install problem, or that it should be fixed in MI. I've refered this bug on to P5P to see their comments.
Download (untitled) / with headers
text/plain 345b
On Thu Feb 23 05:11:04 2006, ADAMK wrote: Show quoted text
> I'm not convinced this is a Module::Install problem, or that it should > be fixed in MI. > > I've refered this bug on to P5P to see their comments.
For the record, Rafael's suggestion of using exists() works fine for me: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-02/msg00810.html


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.