+ Reply to Thread
Results 1 to 2 of 2

Thread: correcting application versions

  1. #1

    correcting application versions

    Our company has variety of applications that has a version number , and versions format can be
    Code:
    02.3a
    04.3b
    10.3c
    So i wanted to change each last alphabet character to a corresponding number like :
    Code:
    02.3a == 02.31
    04.3b == 04.32
    10.3c <> 10.34
    So how to do that ?

  2. #2
    Junior Member
    Join Date
    Jun 2012
    Posts
    41
    You can do it by using that code :
    Code:
    use version qw( qv );
    
    sub normalise_version {
        my ($v) = @_;
        $v =~ s/([a-i])/ ord($1)-ord('a')+1 /eg;
        return qv("v$v");
    }
    
    normalise_version($v1) <=> normalise_version($v2)

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts