Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Version Sorting

by ioannis (Abbot)
on May 30, 2006 at 11:14 UTC ( [id://552470]=note: print w/replies, xml ) Need Help??


in reply to Version Sorting

What about v-strings, or the other equivalent forms of version number ?

Something similar to the version module will be part of Perl 5.10.0 . In the example bellow, note that $a could also have been '1.2.3' or other forms of version number (see perldoc).

use version; # Version comparison # '1.2.3', 'v1.2.3', 1.2.3 my $a = qv( 'v1.2.3' ); my $b = qv( '1.2.29' ); # Compare print +($a>$b) ? $a : $b;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://552470]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found