| Win32-TieRegistry-PMVersionInfo documentation | view source | Contained in the Win32-TieRegistry-PMVersionInfo distribution. |
Win32::TieRegistry::PMVersionInfo - store in Win32 Registry PM $VERSION info
use Win32::TieRegistry::PMVersionInfo 0.2; my $reg = new Win32::TieRegistry::PMVersionInfo ( file_root => "D:/src/pl/spc2xml/version5/", ignore_dirs => ["Commercial/bin/", "Commercial/SPC/XSLT/SourceForge", "Commercial/SPC/XSLT/CSS", "Commercial/SPC/XSLT/imgs",], reg_root => 'LMachine/Software/LittleBits/', strip_path => $strip_path, chat=>1, ); $reg->get; $reg->store; exit;
This module mirrors to the Win32 registry version information from a perl module's heirachy.
It offers no support for reading the information - for that use the Win32::TieRegistry module
on which this module is based.
Version information is ascertained using the same method as in ExtUtils::MakeMaker version 5.45.
To quote that module's manpage:
The first line in the file that contains the regular expression /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/ will be evaluated with eval() and the value of the named variable after the eval() will be assigned to the VERSION attribute of the MakeMaker object. The following lines will be parsed o.k.: $VERSION = '1.00'; *VERSION = \'1.01'; ( $VERSION ) = '$Revision: 1.222 $ ' =~ /\$Revision:\s+([^\s]+)/; $FOO::VERSION = '1.10'; *FOO::VERSION = \'1.11'; our $VERSION = 1.2.3; # new for perl5.6.0 but these will fail: my $VERSION = '1.01'; local $VERSION = '1.02'; local $FOO::VERSION = '1.30'; (Putting "my" or "local" on the preceding line will work o.k.)
Win32::TieRegistry.
Expects a class name, and optionally a list of arguments in a hash-like structure, a hash or pointer to a hash. Options are keys in a the blessed hash reference that is the object, and as such may be directly accessed anytime.
Options are:
The root at which to be begin parsing files.
An array of directories above the file_root not to process.
If any directory encountered matches at the beginning of one of
these strings, it will not be processed.
The text to strip from left-hand side of paths when storing in the registry.
The branch at which to root the mirror of the directory structure.
A positve regular expressions used when reading a directory, which the module
encloses within the bracket 'grouping' operator and anchors to the begining and
end of the string being matched. The . and .. directories are excluded.
As dirname_pattern above, but applies to filenames, and defaults to .*.
Set to anything to retain the file extension when mapping to the registry (the default);
expilcitly set to undef to strip from the filename everything after the last full-stop.
Accepts an object reference, and optionally a directory to parse. Stores the names of all the files
in the passed directory (or the calling object's file_root slot),
and recurses (calls itself) on all sub-directories. Incidentally returns the path to the
directory operated upon.
Will return without reiterating if the directory passed matches at the beginning of
any string in the ignore_dirs list (ie. the value in the object's file_root
plus @{$self-{ignore_dirs}}> slot).
See CONSTRUCTOR for details of how to effect exclusion of file and directory names.
See also DESCRIPTION above for details of how the version is ascertained.
As the get method, but only gets information from files listed
in a MANIFEST file, the path to which should be passed as the first argument.
Additionally, the name of a MANIFEST.SKIP file may be passed as a further argument,
in which case no information will be garthered from files listed therein.
Accepts an object-reference and optionally a registry path to act as a root at which to secure
the $VERSION info from every file in the object's tree slot. If no 'root' is supplied,
the calling object's reg_root slot is used. Incidentally returns the root used after making
changes to the registry.
Be sure to pass all directories with a trailing '/'.
On Win32, it seems the sub get has problems with the -d operator detecting
whether a file is not a directory.
Windows registry, perl module, version information, versions, recursion .
Lee Goddard <lgoddard@cpan.org>
Copyright 2001, Lee Goddard. All rights reserved.
Available for public use under the same terms as Perl itself. This was developed as part of a private project, and is made available without promise of adding anything useful to it.
| Win32-TieRegistry-PMVersionInfo documentation | view source | Contained in the Win32-TieRegistry-PMVersionInfo distribution. |