Called from the top directory of a module distribution, updreadme
will find out what the main *.pm file is, extract the $VERSION
from it and create a README file, consisting of a header
like
##########################################################
Path::Module VERSION
##########################################################
and the result of a pod2text call on the top *.pm file.
It derives the value of VERSION in a somewhat cleaner way than
ExtUtils::MakeMaker does (which brute-force parses the module)
but makes some pretty wild assumptions:
The *.pm file defines one package which contains a global $VERSION
variable.
The * part of *.pm (the module's file name) equals the last part
of the defined package (e.g. if the package is Foo::Bar::Baz, the
filename needs to be Baz.pm. It is not necessary that the file
is located under Foo/Bar, it can as well reside in the current or
any subdirectory.
The module doesn't pull in another module which's last name part
equals the name of the module. E.g. if the module is Foo::Bar::Baz
and it pulls in Blurp::Yada::Baz via use Blurp::Yada::Baz,
then we're hosed, because the algorithm will think that it needs
to fetch $Blurp::Yada::Baz::VERSION.
Copyright 2002 by Mike Schilli, all rights reserved.
This program is free software, you can redistribute it and/or
modify it under the same terms as Perl itself.