Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

How to increment subversion number inside Perl program

by bulrush (Scribe)
on Jul 17, 2014 at 13:39 UTC ( #1094044=perlquestion: print w/ replies, xml ) Need Help??
bulrush has asked for the wisdom of the Perl Monks concerning the following question:

The answer to this could be a 'perl -e' program, or csh or bash solution.

In my Perl program I have the version and subversion numbers like this:

$SUBVER=2; # 2 is current subversion
I have a csh script which copies my test script to my production directory each time I update it. How can I get my 'update' script to increase the $SUBVER number in my perl code each time my 'update' csh script runs?


Perl 5.8.8 on Redhat Linux RHEL 5.5.56 (64-bit)

Comment on How to increment subversion number inside Perl program
Replies are listed 'Best First'.
Re: How to increment subversion number inside Perl program
by Corion (Pope) on Jul 17, 2014 at 13:45 UTC

    If you are willing to depart from your current method of constructing the version, Perl::Version comes with a script, perl-reversion, which can bump anything that looks like a version number in a script.

    I use that script to bump the version when releasing a module. Likely, it wants a line

    $VERSION= '1.0.3';

    in your script to determine the version, instead of what you have now.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1094044]
Approved by GotToBTru
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2015-11-25 15:14 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (680 votes), past polls