Perl::Signature::Set - Create, store and check groups of signatures
There are a number of cases where you might want to create and look after a whole bunch of signatures.
The most common of these is:
1. Generate signatures 2. Do some process that shouldn't change the files functionally 3. Test to make sure it didn't
Examples for 2. could be things like applying Perl::Tidy, merging in documentation-only patches from external sources, and other similar things.
Perl::Signature::Set lets you create an object that can store a while bunch of file signatures, save the set to a file, load it in again, and test the lot to check for changes.
For simplicity and easy of creation, Perl::Signature::Set has been implemented as a subclass of Config::Tiny.
Creates a new Perl::Signature::Set object. Takes as an optional argument the normalization layer you wish to use.
Returns a new Perl::Signature::Set object.
The layer accessor returns the normalization layer that was used for all of the signatures in the object.
layer
The add method takes the name of a file to generate a signature for and add to the set.
add
Returns the actual Perl::Signature object created as a convenience, or undef if the file has already been added, or on error.
undef
The files method provides all of the names of the files contained in the set, in default sorted order.
files
Returns a list of file names, or the null list if the set contains no files.
The file method is used to get the Perl::Signature object for a single named file.
file
Returns a Perl::Signature object, or undef if the file is not in the set.
The signatures method returns all of the Signature objects from the Set, in filename-sorted order.
signatures
Returns a list of Perl::Signature objects, or the null list if the set does not contain any Signature objects.
The changes method checks the signatures for each file and provides a hash listing the files that have changed as the key, and either "changed" or "removed" as the value.
changes
Returns a HASH reference, false ('') if there are no changes, or undef on error.
''
All bugs should be filed via the CPAN bug tracker at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl-Signature
For other issues, or commercial enhancement or support, contact the author.
Adam Kennedy <adamk@cpan.org>
http://ali.as/, PPI, Perl::Signature, Perl::Compare
Copyright 2005 - 2008 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
To install Perl::Signature, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Signature
CPAN shell
perl -MCPAN -e shell install Perl::Signature
For more information on module installation, please visit the detailed CPAN module installation guide.