Stephan Kulow's avatar

Stephan Kulow

coolo

Member of the groups
Involved Projects and Packages

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.

sorry, no description found

sorry, no description found

String::Formatter is a tool for building sprintf-like formatting routines.
It supports named or positional formatting, custom conversions, fixed
string interpolation, and simple width-matching out of the box. It is easy
to alter its behavior to write new kinds of format string expanders. For
most cases, it should be easy to build all sorts of formatters out of the
options built into String::Formatter.

Normally, String::Formatter will be used to import a sprintf-like routine
referred to as "'stringf'", but which can be given any name you like. This
routine acts like sprintf in that it takes a string and some inputs and
returns a new string:

my $output = stringf "Some %a format %s for you to %u.\n", { ... };

This routine is actually a wrapper around a String::Formatter object
created by importing stringf. In the following code, the entire hashref
after "stringf" is passed to String::Formatter's constructor (the 'new'
method), save for the '-as' key and any other keys that start with a dash.

use String::Formatter
stringf => {
-as => 'fmt_time',
codes => { ... },
format_hunker => ...,
input_processor => ...,
},
stringf => {
-as => 'fmt_date',
codes => { ... },
string_replacer => ...,
hunk_formatter => ...,
},
;

As you can see, this will generate two stringf routines, with different
behaviors, which are installed with different names. Since the behavior of
these routines is based on the 'format' method of a String::Formatter
object, the rest of the documentation will describe the way the object
behaves.

There's also a 'named_stringf' export, which behaves just like the
'stringf' export, but defaults to the 'named_replace' and
'require_named_input' arguments. There's a 'method_stringf' export, which
defaults 'method_replace' and 'require_single_input'. Finally, a
'indexed_stringf', which defaults to 'indexed_replaced' and
'require_arrayref_input'. For more on these, keep reading, and check out
the cookbook.

the String::Formatter::Cookbook manpage provides a number of recipes for
ways to put String::Formatter to use.

a module for when strings are too long to be displayed in...

The synopsis section, above, looks almost indistinguishable from any other
use of Sub::Exporter, apart from the use of 'method_installer'. It is
nearly indistinguishable in behavior, too. The only change is that
subroutines exported from Method::Builder into named slots in
Vehicle::Autobot will be wrapped in a subroutine called
'Vehicle::Autobot::transform'. This will insert a named frame into stack
traces to aid in debugging.

More importantly (for the author, anyway), they will not be removed by
namespace::autoclean. This makes the following code work:

package MyLibrary;

use Math::Trig qw(tan); # uses Exporter.pm
use String::Truncate qw(trunc); # uses Sub::Exporter's defaults

use Sub::Exporter::ForMethods qw(method_installer);
use Mixin::Linewise { installer => method_installer }, qw(read_file);

use namespace::autoclean;

...

1;

After MyLibrary is compiled, 'namespace::autoclean' will remove 'tan' and
'trunc' as foreign contaminants, but will leave 'read_file' in place. It
will also remove 'method_installer', an added win.

This module enables you to export shared globs with Sub::Exporter
collectors

openSUSE Build Service is sponsored by