On 4/4/2004 5:14 PM, Ken Williams wrote:
Hi,
There's a patch from Trevor Schellhorn on RT pertaining to version.pm and Module::Build:
https://rt.cpan.org/Ticket/Display.html?id=5720
At issue is the fact that some modules are doing things like the following for setting their versions:
use version; $VERSION = version->new("12.2.1");
When M::B attempts to find the $VERSION of such a module, it evals the second line in isolation, and version.pm isn't loaded so it fails.
On the one hand, we could probably fix it easily by applying Trevor's patch.
On the other hand, versions have always been required to be contained all in one line, so maybe we should insist that people change their code to:
use version; $VERSION = version->new("12.2.1");
Thoughts?
I can't remember. Is this carried out before or after requirements processing in M::B? I ask because it's possible that version.pm is not present on perl < 5.8... Well, that's a minor issue.
If there is any way possible, I wish we could find a way to eliminate $VERSION hacks. I really don't know enough about the issues involved, but can't we scan the whole file recording every occurence of $VERSION (noting that there can be multiple packages in a file), and run it through a few rules to come up with an educated (probabilistic) guess?
Randy (version ignorant)
