Subject: | Systems without Scalar::Util::isvstring unable to check requisite modules in ExtUtils::MakeMaker |
Line 32 to 35:
my $eval = eval 'Scalar::Util::isvstring($value)';
if ( !$@ and $eval ) {
$value = sprintf("v%vd",$value);
}
On systems without ivstring (Perl 5.6.2 in this case), calls to the
subroutine issue a croak. Since $@ is being handled in your code, it
shouldn't be allowed to propogate to other modules.
The end result is that ExtUtils::MakeMaker will see $@ when it is
require'ing in the module requisites and will erroneously detect a
require failure.
This is the CLI result:
[root@hypercube Unix-PID-v0.0.6]# perl Makefile.PL
Warning: prerequisite Class::Std 0 not found.
Warning: prerequisite Class::Std::Utils 0 not found.
Warning: prerequisite version 0 not found.
Writing Makefile for Unix::PID
To resolve this issue, I've added an "undef $@;" following the conditional.
After adding "undef $@;":
[root@hypercube Unix-PID-v0.0.6]# perl Makefile.PL
Writing Makefile for Unix::PID
Additionally, by overloading the 'cmp' operator (which I was suprised to
learn the 'eq' uses) to call vcmp, string comparisons in
ExtUtils::MakeMaker are overloaded as well.
This is the generated error I'm seeing:
[root@hypercube Unix-PID-v0.0.6]# perl Makefile.PL
Version string 'undef' contains invalid data; ignoring: 'undef' at
/usr/local/cpanel/perl/lib/site_perl/5.6.2/version/vpp.pm line 201.
Writing Makefile for Unix::PID
Changing ExtUtils/MM_Any.pm line 1307 from:
if( $self->{VERSION} eq 'undef' ) {
to:
if( "$self->{VERSION}" eq 'undef' ) {
allows everything to work properly, as you've overloaded '""' to call
your stringify subroutine.
I'm not sure what the best way to handle to operator overloading issue
would be, but I suspect that the best practice in this case would be to
not overload any operators and call their respective subroutines
directly when needed.
Let me know if there's any additional assistance I can offer.
Thanks