in reply to $VERSION diversion

edit: this seems to work much better than my original idea:

our $VERSION; my $version_pod = <<"=cut"; =pod =head1 NAME blah blah =head1 VERSION @{[ $VERSION = "0.23" ]} =cut
update: any ideas how to get the @{[]} stuff out with =for comment?

here my original idea:

i found a very easy way to keep pod version numbers up-to-date. don't know if that helps in your case, but here it is:
my $version_pod = <<'=cut'; =pod =head1 NAME blah blah... =head1 VERSION our $VERSION = "0.63"; =cut our $VERSION = "0.63"; # ... sub __test_version { my $v = __PACKAGE__->VERSION; return 1 if $version_pod =~ m/VERSION.*\Q$v/; return; }
testfile:
use Test::More tests => 2; BEGIN { use_ok('My::Module') }; ok(My::Module->__test_version, "version ok");
as i do make test as often as possible, i never forget the version number...

still, it would be cool if you could do

our $VERSION = ($version_pod =~ m/^our \$VERSION = "(\d+(?:\.\d+)+)"/m +) ? $1 : "0.01";
but doesn't work with make tardist, for example