Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

How to increment subversion number inside Perl program

by bulrush (Beadle)
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
$VER="1.0.".sprintf("%03d",$SUBVER);
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?

Thanks.

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

Comment on How to increment subversion number inside Perl program
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2014-12-21 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls