Hi Folks This went straight to David, instead of the list :-(.
-------- Forwarded Message -------- > From: Ron Savage <r...@savage.net.au> > To: David Golden <xda...@gmail.com> > Subject: Re: Finding all version numbers in a distro's *.pm files > Date: Tue, 01 Sep 2009 12:00:38 +1000 > > Hi David > > I had a feeling this wouldn't be a simple as possible... > > On Mon, 2009-08-31 at 21:30 -0400, David Golden wrote: > > On Mon, Aug 31, 2009 at 9:04 PM, Ron Savage<r...@savage.net.au> wrote: > > > Hi Folks > > > > > > I've been reading up on version numbers and the docs for version.pm, > > > and looking on CPAN for this one. > > > > > > Is there a program/module which will scan all *.pm files in a dir, and > > > extract what version.pm thinks are version numbers? > > > > That's a rather convoluted issue. Can you be more specific what > > you're trying to do? Here are some qualifying questions (not mutually > > exclusive): > > > As stated just above, differently :-). > > I want to ensure all files in the dir return the same version number, if > I print them using version.pm. > > > > * What version.pm "thinks" -- meaning internal representation? > > > > * What version.pm will output as a string? What it will output in > > 'normalized' form? In numeric form? (All of these can differ) > > > As a string will do just fine. > > > > * What version.pm will make of the EU::MM->parse_version result? E.g. > > "say version->new( ExtUtils::MM->parse_version($file) )->normal" > > (Also, depending on the version of EU::MM, it will load version.pm if > > available) > > > > * What Foo->VERSION will give if version.pm is loaded? (Not > > necessarily the same as the parse_version result) > > > > * Which version of perl? 5.6.X? 5.8.0? 5.8.[1-9]? 5.10.X? All > > potentially different answers > > > The version I'm running, 5.10.0. > > > > Given all that, I know of nothing on CPAN that can easily (and > > correctly) answer your question. Aren't you glad you asked? :-) > > > If such a program fails on some modules, that does not worry me, since I > would be almost always using it on my own code, or on modules such as > CGI::Session where I do most of the maintenance. > > Code which purports to do this, none of which seem to use version.pm, > are: > > o Module::Extract::VERSION > > o Module::Build::DistVersion > > o version.pl (Module::Info::File) > -- Ron Savage r...@savage.net.au http://savage.net.au/index.html