Involved Projects and Packages
A logging role building a very lightweight wrapper to the Log::Log4perl
manpage for use with your the Moose manpage classes. The initialization of
the Log4perl instance must be performed prior to logging the first log
message. Otherwise the default initialization will happen, probably not
doing the things you expect.
For compatibility the 'logger' attribute can be accessed to use a common
interface for application logging.
For simple logging needs use the MooseX::Log::Log4perl::Easy manpage to
directly add log_ methods to your class instance.
$self->log_info("Dummy");
This module does not provide any methods. Simply loading it changes the
default naming policy for the loading class so that accessors are separated
into get and set methods. The get methods have the same name as the
accessor, while set methods are prefixed with "set_".
If you define an attribute with a leading underscore, then the set method
will start with "_set_".
If you explicitly set a "reader" or "writer" name when creating an
attribute, then that attribute's naming scheme is left unchanged.
The name "semi-affordance" comes from David Wheeler's Class::Meta module.
Net::DNS::Resolver::Programmable is a Net::DNS::Resolver descendant class that
allows a virtual DNS to be emulated instead of querying the real DNS. A set of
static DNS records may be supplied, or arbitrary code may be specified as a
means for retrieving DNS records, or even generating them on the fly.
the Object::Signature manpage is an abstract base class that you can
inherit from in order to allow your objects to generate unique
cryptographic signatures.
The method used to generate the signature is based on the Storable manpage
and the Digest::MD5 manpage. The object is fed to 'Storable::nfreeze' to
get a string, which is then passed to the Digest::MD5::md5_hex manpage to
get a unique 32 character hexidecimal signature.
This is a backend for the Package::Stash manpage, which provides the
functionality in a way that's less buggy and much faster. It will be used
by default if it's installed, and should be preferred in all environments
with a compiler.
*Parse::CPAN::Meta* is a parser for _META.json_ and _META.yml_ files, using
the JSON::PP manpage and/or the CPAN::Meta::YAML manpage.
*Parse::CPAN::Meta* provides three methods: 'load_file',
'load_json_string', and 'load_yaml_string'. These will read and deserialize
CPAN metafiles, and are described below in detail.
*Parse::CPAN::Meta* provides a legacy API of only two functions, based on
the YAML functions of the same name. Wherever possible, identical calling
semantics are used. These may only be used with YAML sources.
All error reporting is done with exceptions (die'ing).
Note that META files are expected to be in UTF-8 encoding, only. When
converted string data, it must first be decoded from UTF-8.
The scanner will extract loosely your distribution prerequisites from your
files.
The extraction may not be perfect but tries to do its best. It will
currently find the following prereqs:
* *
plain lines beginning with 'use' or 'require' in your perl modules and
scripts, including minimum perl version
* *
regular inheritance declared with the 'base' and 'parent' pragmata
* *
the Moose manpage inheritance declared with the 'extends' keyword
* *
the Moose manpage roles included with the 'with' keyword
It will trim the following pragamata: 'strict', 'warnings', and 'lib'.
'base' is trimmed unless a specific version is required. 'parent' is kept,
since it's only recently become a core library.
Perl::Version provides a simple interface for parsing, manipulating and
formatting Perl version strings.
Unlike version.pm (which concentrates on parsing and comparing version
strings) Perl::Version is designed for cases where you'd like to parse a
version, modify it and get back the modified version formatted like the
original.
For example:
my $version = Perl::Version->new( '1.2.3' );
$version->inc_version;
print "$version\n";
prints
1.3.0
whereas
my $version = Perl::Version->new( 'v1.02.03' );
$version->inc_version;
print "$version\n";
prints
v1.03.00
Both are representations of the same version and they'd compare equal but
their formatting is different.
Perl::Version tries hard to guess and recreate the format of the original
version and in most cases it succeeds. In rare cases the formatting is
ambiguous. Consider
1.10.03
Do you suppose that second component '10' is zero padded like the third
component? Perl::Version will assume that it is:
my $version = Perl::Version->new( '1.10.03' );
$version->inc_revision;
print "$version\n";
will print
2.00.00
If all of the components after the first are the same length (two
characters in this case) and any of them begins with a zero Perl::Version
will assume that they're all zero padded to the same length.
The first component and any alpha suffix are handled separately. In each
case if either of them starts with a zero they will be zero padded to the
same length when stringifying the version.
Regexp::Assemble takes an arbitrary number of regular expressions and
assembles them into a single regular expression (or RE) that matches all
that the individual REs match.
As a result, instead of having a large list of expressions to loop over, a
target string only needs to be tested against one expression. This is
interesting when you have several thousand patterns to deal with. Serious
effort is made to produce the smallest pattern possible.
It is also possible to track the original patterns, so that you can
determine which, among the source patterns that form the assembled pattern,
was the one that caused the match to occur.
You should realise that large numbers of alternations are processed in
perl's regular expression engine in O(n) time, not O(1). If you are still
having performance problems, you should look at using a trie. Note that
Perl's own regular expression engine will implement trie optimisations in
perl 5.10 (they are already available in perl 5.9.3 if you want to try them
out). 'Regexp::Assemble' will do the right thing when it knows it's running
on a a trie'd perl. (At least in some version after this one).
Some more examples of usage appear in the accompanying README. If that file
isn't easy to access locally, you can find it on a web repository such as
the http://search.cpan.org/dist/Regexp-Assemble/README manpage or the
http://cpan.uwinnipeg.ca/htdocs/Regexp-Assemble/README.html manpage.
Smart comments provide an easy way to insert debugging and tracking code
into a program. They can report the value of a variable, track the progress
of a loop, and verify that particular assertions are true.
Best of all, when you're finished debugging, you don't have to remove them.
Simply commenting out the 'use Smart::Comments' line turns them back into
regular comments. Leaving smart comments in your code is smart because if
you needed them once, you'll almost certainly need them again later.