On Monday, November 11, 2002, at 03:22 PM, Stas Bekman wrote:
Andreas J. Koenig wrote:Well, usually there is one $VERSION per a collection of several files. But sure this workaround should be OK.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.
Another workaround would be to disguise the $VERSION line:
no strict 'vars'; unless (${'File::Spec::V' .'ERSION'} >= $min_version) { ... Or even better: unless (File::Spec->VERSION >= $min_version) { ...
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().I think that by finding a VERSION MakeMaker has committed to thinking that there's a real VERSION in the file, and then it dies because its commitment was wrong. This is documented - the MakeMaker docs say that the first line matching
/([\$*])(([\w\:\']*)\bVERSION)\b.*\=/
will be treated as a version number. I don't really like it any more than you do, but it's behaving as documented.
-Ken