Ken Williams wrote:
On Monday, November 11, 2002, at 03:22 PM, Stas Bekman wrote:
Andreas J. Koenig wrote:
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.
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) {
...
I like the later version. Thanks Ken.
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.
OK, going to change my code to use File::Spec->VERSION :)
__________________________________________________________________
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