in reply to $VERSION diversion
edit: this seems to work much better than my original idea:
update: any ideas how to get the @{[]} stuff out with =for comment?our $VERSION; my $version_pod = <<"=cut"; =pod =head1 NAME blah blah =head1 VERSION @{[ $VERSION = "0.23" ]} =cut
here my original idea:
testfile: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; }
as i do make test as often as possible, i never forget the version number...use Test::More tests => 2; BEGIN { use_ok('My::Module') }; ok(My::Module->__test_version, "version ok");
still, it would be cool if you could do
but doesn't work with make tardist, for exampleour $VERSION = ($version_pod =~ m/^our \$VERSION = "(\d+(?:\.\d+)+)"/m +) ? $1 : "0.01";
|
|---|