Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 15054
Status: resolved
Priority: 0/
Queue: ExtUtils-MakeMaker

People
Owner: Nobody in particular
Requestors: cpan [...] steffen-winkler.de
Cc:
AdminCc:

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



Subject: I detected a problem in ExtUtils::MakeMaker’s created MAKEFILE.
Think about this: In module: # gets a version from CVS our $VERSION = eval 'v'.qw($Revision: 1.10 $)[1]; In Script or module: use Module v1.10; # creates a compile time error # v1.9 is less then v1.10. The problem is: The MAKEFILE includes VERSION= and then 2 binary chars. Often it isn’t really bad. But in Version v1.36 the chars are \1 followed by $ and make creates an error. But MG_TYPE = ... (V) and MG_PTR = ... "v1.36" show you that $VERSION is not really a String or Number. Typical Perl version check converts v1.36 to 1.036 to compare it with a number. I show you the dumped $VERSION created by Devel::Peek. SV = PVMG(0x19df07c) at 0x22616c REFCNT = 1 FLAGS = (PADBUSY,PADTMP,RMG,POK,READONLY,pPOK) IV = 0 NV = 0 PV = 0x183319c "\1$"\0 CUR = 2 LEN = 6 MAGIC = 0x1c9535c MG_VIRTUAL = 0 MG_TYPE = PERL_MAGIC_v-string(V) MG_LEN = 5 MG_PTR = 0x182a5c4 "v1.36"
Date: Fri, 14 Oct 2005 15:44:49 -0700
From: Michael G Schwern <schwern [...] pobox.com>
To: via RT <bug-ExtUtils-MakeMaker [...] rt.cpan.org>
CC: undisclosed-recipients: ;
Subject: Re: [cpan #15054] I detected a problem in ExtUtils::MakeMaker’s created MAKEFILE.
RT-Send-Cc:
On Fri, Oct 14, 2005 at 05:53:42AM -0400, via RT wrote: Show quoted text
> Think about this:
I'd really rather not. It doesn't have much to do with MakeMaker, v-strings are their own thing. They never worked right, are overcomplicated and have been deprecated. perldata sez: Note: Version Strings (v-strings) have been deprecated. They will not be available after Perl 5.8. The marginal benefits of v-strings were greatly outweighed by the potential for Surprise and Confusion. There's version objects, which I also think are overcomplicated, but at least they're not deprecated: http://search.cpan.org/dist/version/ Show quoted text
> In module: > # gets a version from CVS > our $VERSION = eval 'v'.qw($Revision: 1.10 $)[1];
I would suggest using MakeMaker's recommended method of getting versions from $Revision$. The important thing being that your revisions sort *numericly* (ie. 1.9 is higher than 1.10) so all versions should have the same number of decimal digits. (1.09, 1.10, 1.11, etc..). http://search.cpan.org/~mschwern/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/FAQ.pod#Module_Writing -- Michael G Schwern schwern@pobox.com http://www.pobox.com/~schwern Ahh email, my old friend. Do you know that revenge is a dish that is best served cold? And it is very cold on the Internet!
From: cpan [...] steffen-winkler.de
Thanks for the reference. I didn't know that v-strings are deprecatd. For me they were lifenear as the numeric way of writing such as 1.002_003 or CPAN's 2 digit way. We humans use and understand 1.2.3 dayly as version, IP address or in a table of contents. [schwern@pobox.com - Fri Oct 14 18:45:29 2005]: Show quoted text
> It doesn't have much to do with MakeMaker, v-strings are their own > thing.
MakeMaker transport them to MAKEFILE binary and then make is going to crash. Perl internal version control know them or compare them with numbers like 3 digit blocks.
Resolution: don't use v-strings.