Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    # but this won't compile, --- why?
    #$version =~ s/(\d+\.\d+\.)(\d+)(\.\d+)/{$1}$2+1{$3}/e;
    print $version;
    
  2. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    
    $version =~ s/(\d+)(?=\.\d+\z)/$1 + 1/e;
    print "$version\n";