Andreas J. Koenig wrote:
On Sat, 09 Nov 2002 23:43:36 +0800, Stas Bekman <[EMAIL PROTECTED]> said:
> Andreas J. Koenig wrote:
>>>>>>> On Thu, 05 Sep 2002 09:41:35 +0800, Stas Bekman <[EMAIL PROTECTED]> said:
>>>>>> >> > when it tries to eval:
>> > $File::Spec::VERSION=undef; do {
>> > unless ($File::Spec::VERSION >= $min_version) {
>> > };
>> > it certainly fails. And this is a bug in makemaker, not my code.
>> > Moreover this bug doesn't exist in MM 6.03, but does exist in 6.05 and
>> > versions prior to 6.00.
>> It has always been decreed that the $VERSION line ***must*** be
>> written in a single self-containing line. You need to change your
>> $VERSION line.
>> If 6.03 parses this right, it was a bug in MM 6.03.

> [ returning from a long vacation... ]

I hope it was an enjoyable vacation...
It was definitely a great one :)

  > Andreas, this is not the $VERSION line that I'm talking about. This is
  > some code that checks the version of a different module:

  >    unless ($File::Spec::VERSION >= $min_version) {

  > I beg your pardon, but I can't see what this has to do with the
  > $VERSION line.

I see. Sorry, I missed the point of your mail.

The point was, that a third party module doesn't contain a $VERSION
line of its own but does deal with $VERSION stuff within the module.
Whenever MakeMaker tries to parse the version, it fails miserably.

I'd say there is one very easy fix: ask the author of the module to
include a $VERSION line near the top of the file, at least before he
starts himself to deal with VERSION stuff.

Did I get it right this time?
Yup :)

A solution that involves MakeMaker's parse_version directly will be
hard to find and will probably break existing code. I wouldn't go up
this steep path.
My proposed solution was to ignore anything but $VERSION or ${__PACKAGE__ . "::VERSION"}, but I can see that it can be a major trouble.

Asking an author to include a $VERSION is a fair request.
$VERSION-less scripts and modules are a major PITA, no matter if it's
for MakeMaker or for somebody else.
Well, usually there is one $VERSION per a collection of several files. But sure this workaround should be OK.

In any case. Any reason why the parse_version isn't using eval and avoiding fatal errors? If it fails to get the version, just move on, don't screw the output of CPAN.pm in this particular case. I suppose at least CPAN.pm could wrap this call in eval().

__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@;stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com

Reply via email to