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

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2017-10-22 01:11 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (271 votes). Check out past polls.