Skip Menu |

This queue is for tickets about the version CPAN distribution.

Report information
The Basics
Id: 19517
Status: resolved
Priority: 0/
Queue: version

People
Owner: Nobody in particular
Requestors: ben [...] cpanel.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.61
Fixed in: (no value)



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
CC: ben [...] cpanel.net
Subject: Re: [rt.cpan.org #19517] Systems without Scalar::Util::isvstring unable to check requisite modules in ExtUtils::MakeMaker
Date: Fri, 26 May 2006 23:30:25 -0400
To: bug-version [...] rt.cpan.org
From: John Peacock <jpeacock [...] rowman.com>
Guest via RT wrote: Show quoted text
> 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.
Guilty as charged (though I'll clear $@ inside the conditional). I'll have to think how I can test for this so I don't make this kind of mistake in the future. Show quoted text
> 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.
Yes, but string comparisons have to be overloaded, else the version objects won't do what they are designed to do. This particular problem lies with the usage in ExtUtils::MM_Any, but I suppose I'll have to cope with it. Show quoted text
> 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.
As I said above, without overloading, the version objects won't function. I'll have to special-case 'undef' (just like the strings 'inf' and 'NaN' are special-cased in numeric contexts). Thanks for the concise report... John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747
RT-Send-CC: ben [...] cpanel.net
Resolved with version-0.62, though I see I am leaking some undef warnings in the XS code. Thanks for helping improve the code... John