Subject: | Parsing of $VERSION fails for certain packages |
Certain packages (e.g. HTML::WebMake::HTMLCleaner) don't contain a $VERSION of their own but code like
# this parameter is not supported in earlier versions
if ($HTML::Parser::VERSION >= 3.00) {
my $val = '==BOOL_TRUE==';
eval '
$self->boolean_attribute_value ($val);
$BOOL_ATTR_VALUE = $val;
';
}
ExtUtils::MM_Unix produces error messages like this one if checking for a
VERSION (e.g. from inside CPAN.pm with the "r" command):
Could not eval '
package ExtUtils::MakeMaker::_version;
no strict;
local $HTML::Parser::VERSION;
$HTML::Parser::VERSION=undef; do {
if ($HTML::Parser::VERSION >= 3.00) {
}; $HTML::Parser::VERSION
' in /usr/lib/perl5/site_perl/5.8.0/HTML/WebMake/HTMLCleaner.pm: Missing right curly or square bracket at (eval 541) line 10, at end of line
syntax error at (eval 541) line 10, at EOF
Attached is a patch which solves this. A much better solution would be an applied standard for specifying package versions, of course.
--- MM_Unix.pm 2004-12-15 13:01:32.000000000 +0100
+++ MM_Unix.pm.orig 2005-01-05 22:58:42.000000000 +0100
@@ -3042,6 +3042,7 @@
next if $inpod || /^\s*#/;
chop;
next unless /(?<!\\)([\$*])(([\w\:\']*)\bVERSION)\b.*\=/;
+ next if /^\s*(if|unless)/;
my $eval = qq{
package ExtUtils::MakeMaker::_version;
no strict;