Skip Menu |

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

Maintainer(s)' notes

Attention bug reporters: issues MUST include the version of Module::Metadata that you are running that exhibit the stated symptoms. thank you!

Report information
The Basics
Id: 85961
Status: resolved
Priority: 0/
Queue: Module-Metadata

People
Owner: ether [...] cpan.org
Requestors: jeff [...] imaginative-software.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.000028-TRIAL



Subject: Why does $Foo::VERSION imply package Foo?
Date: Fri, 7 Jun 2013 15:45:07 -0700
To: bug-Module-Metadata [...] rt.cpan.org
From: Jeffrey Ryan Thalhammer <jeff [...] imaginative-software.com>
If Module::Metadata sees a fully qualified VERSION variable... $Foo::Bar::VERSION = 1.23; ...then it claims the file provides a package called Foo::Bar, even if no such package was actually declared in the file. That behavior seems dubious to me. Can you help me understand the rationale for it? Here's the relevant line of code: https://metacpan.org/source/BOBTFISH/Module-Metadata-1.000014/lib/Module/Metadata.pm#L589 Thanks for your time. -Jeff
Subject: Re: [rt.cpan.org #85961] Why does $Foo::VERSION imply package Foo?
Date: Fri, 7 Jun 2013 22:36:41 -0400
To: bug-Module-Metadata [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Fri, Jun 7, 2013 at 6:45 PM, Jeffrey Thalhammer via RT <bug-Module-Metadata@rt.cpan.org> wrote: Show quoted text
> That behavior seems dubious to me. Can you help me understand the rationale for it? Here's the relevant line of code:
Randy Sims introduced it in this Module::Build commit: https://github.com/Perl-Toolchain-Gang/Module-Build/commit/be8b29e0 No apparent rationale. -- David Golden <dagolden@cpan.org> Take back your inbox! → http://www.bunchmail.com/ Twitter/IRC: @xdg
Subject: Re: [rt.cpan.org #85961] Why does $Foo::VERSION imply package Foo?
Date: Fri, 7 Jun 2013 21:25:25 -0700
To: bug-Module-Metadata [...] rt.cpan.org
From: Jeffrey Ryan Thalhammer <jeff [...] imaginative-software.com>
On Jun 7, 2013, at 7:37 PM, David Golden via RT wrote: Show quoted text
> No apparent rationale.
IMHO, merely declaring a $Foo::Bar::VERSION does not mean the file actually provides the Foo::Bar package. So far, I can't think of any reason why it should. But that code has been in there for so long, and M::M is such an integral part of the toolchain, I can't imagine changing it now. And looking around on CPAN, I see evidence that some authors may actually rely on this (mis)feature. So you can go ahead and close this ticket. Thanks for helping with the investigating :-) -Jeff
Subject: Re: [rt.cpan.org #85961] Why does $Foo::VERSION imply package Foo?
Date: Sat, 8 Jun 2013 07:29:11 -0400
To: bug-Module-Metadata [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Sat, Jun 8, 2013 at 12:25 AM, Jeffrey Thalhammer via RT <bug-Module-Metadata@rt.cpan.org> wrote: Show quoted text
> And looking around on CPAN, I see evidence that some authors may actually rely on this (mis)feature.
I'm surprised. Unless PAUSE does the same, I'd yank it. -- David Golden <dagolden@cpan.org> Take back your inbox! → http://www.bunchmail.com/ Twitter/IRC: @xdg
Subject: Re: [rt.cpan.org #85961] Why does $Foo::VERSION imply package Foo?
Date: Sat, 8 Jun 2013 09:38:16 -0700
To: David Golden via RT <bug-Module-Metadata [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Sat, Jun 08, 2013 at 07:29:58AM -0400, David Golden via RT wrote: Show quoted text
> > And looking around on CPAN, I see evidence that some authors may actually rely on this (mis)feature.
> > I'm surprised. > > Unless PAUSE does the same, I'd yank it.
Rely how? I'd much prefer to fix the broken modules than to keep this behaviour, if at all possible.
Show quoted text
> Rely how? I'd much prefer to fix the broken modules than to keep this behaviour, if at all possible.
I thought mod_perl did it, but I was mistaken. It uses both package declarations AND fully qualified $VERSION variables. So I'm also in favor of removing it.
This must be addressed by/at Berlin QAH.
I would be in favor of removing this. I don't think it makes much sense in general, and also doesn't match the behavior of PAUSE.
On Wed Mar 04 14:29:17 2015, haarg wrote: Show quoted text
> I would be in favor of removing this. I don't think it makes much > sense in general, and also doesn't match the behavior of PAUSE.
Looks like - if ($package and $version_package eq $package) { immediately inside the # VERSION defined with full package spec, i.e. $Module::VERSION } elsif ( $version_fullname && $version_package ) { does something reasonable.
If this gets fixed, this issue should be fixed: http://www.cpantesters.org/cpan/report/817b846a-1d60-11e5-b223-8c49e0bfc7aa http://www.cpantesters.org/cpan/report/83e86ace-1d60-11e5-b223-8c49e0bfc7aa "- local $B::VERSION" is being extracted from a here-doc and evaluated, which causes an exception.
Can we just make this change and ship a dev version? Nobody has spoken up in favor of it, and if it causes issues we want to be made aware of them.
On 2015-06-28 20:54:26, haarg wrote: Show quoted text
> Can we just make this change and ship a dev version? Nobody has > spoken up in favor of it, and if it causes issues we want to be made > aware of them.
Yes, I'm working on it.
Another manifestation: https://github.com/thaljef/Pinto/issues/204#issuecomment-130140089 I will hustle a fix.
RT-Send-CC: dagolden [...] cpan.org
Fixed in 1.000028-TRIAL.