develooper Front page | perl.perl5.porters | Postings from August 2001

Re: [PATCH 2 of 3] $] is deprecated - EXTERMINATE, EXTERMINATE, EXTERMINATE

Thread Previous | Thread Next
From:
John Peacock
Date:
August 23, 2001 08:59
Subject:
Re: [PATCH 2 of 3] $] is deprecated - EXTERMINATE, EXTERMINATE, EXTERMINATE
Message ID:
3B8527D0.BB4D2F3D@rowman.com
Ronald J Kimball wrote:
> 
> Well, since you asked...  ;)
> 
> The Top 5 Reasons Version Strings Really Suck:
> 
> 5. Version numbers can be printed directly.  Version strings have to be
>    reformatted in order to be printed.

If we wanted to, we could force you to ask for a version string in 
native Unicode format and then overload the print to force "%vd" 
handling.  I'm not going there (at this point anyways ;~).

> 
> 4. The version string 5.6.1 corresponds to the numeric version 5.006_001,
>    but not to the version string 5.006.001, because that's unsupported.

My patch(s) will support this.  All three of the notations you mention
would be coded as "\5\6\1" internally.  Version strings have NO numeric
equivalent.  This seems most like what Larry intended for them.

> 
> 3. The v is optional, sometimes.  5.6.1 is a version string, but 5.6 isn't.
>    And what about v5?

If it is used as a version string, it will be upgraded to be a version
string (if the tokenizer didn't already catch it).  So

	$VERSION = "5.6.1";  
and	$VERSION = 5.6.1;

would both be compared as "\5\6\1" automagically.

> 
> 2. It's a method for ensuring the version of perl, but it's not compatible
>    with older versions of perl.  What a brilliant idea!

You have to upgrade eventually. ;~)

> 
> 1. Is v1.300 equal to v1.196.172?  Yes.  I mean no.  I mean...  What was
>    the question again?

Can't help you there.  Since both representations in Unicode are the
same, the version strings will be equivalent.  This should be an 
unlikely occurance for versions, unless someone is using CVS a little
too religiously (I changed "d" to "D", I better commit ;~).  

Oh, and speaking of CVS, if this all works, you will be able to use

	$VERSION = qw$Revision: 1.51 $[1];

and be sure that v10.10 > v10.9!

Thanks for sharing!  :~)

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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About