in reply to 3 packages 1 uniform version

jonasbn:

You could put an easily-recognized version statement in your modules, and sync them with a perl one-liner. So if your version statement was always in the form:

$VERSION='1.34';
then you could update all your versions to be the same with:

perl -pi -e 's/^$VERSION='\d\.\d\d';/$VERSION='2.56';/' foo.pl

...roboticus

Replies are listed 'Best First'.
Re^2: 3 packages 1 uniform version
by jonasbn (Scribe) on Feb 09, 2008 at 22:47 UTC
    You gave me a marvelous idea, the updating of the version number is now a part of the distribution building. Thanks for the suggestion, you got me thinking outside the box.
      I do this in all my packages: Create a VERSION.pm containing the following code:
      package Foo::VERSION; $VERSION=(qw$Revision: 1.119 $)[1];
      Which is updated by cvs everytime I check the package in. In each subpackage I have the following line:
      $VERSION = eval { require Foo::VERSION; do $INC{'Foo/VERSION.pm'}};
      Must be all on one line if you want it interpreted by CPAN etc.
        I'd simplify as follows:
        Package Foo::VERSION; $VERSION = '$Revision: 1.119 $'; # or $VERSION = q$Revision: 1.119 $;
        and then
        $VERSION = eval { require Foo::VERSION; $Foo::VERSION::VERSION };

        Hey! Up to Dec 16, 2007 I was named frodo72, take note of the change! Flavio
        perl -ple'$_=reverse' <<<ti.xittelop@oivalf

        Io ho capito... ma tu che hai detto?