Pascal Bleser
pbleser
Involved Projects and Packages
Config::Any provides a facility for Perl applications and libraries to load
configuration data from multiple different file formats. It supports XML, YAML,
JSON, Apache-style configuration, Windows INI files, and even Perl code.
The rationale for this module is as follows: Perl programs are deployed on many
different platforms and integrated with many different systems. Systems
administrators and end users may prefer different configuration formats than
the developers. The flexibility inherent in a multiple format configuration
loader allows different users to make different choices, without generating
extra work for the developers. As a developer you only need to learn a single
interface to be able to use the power of different configuration formats.
This module handles interaction with configuration files of the style used
by the version control system Git. It can both parse and modify these
files, as well as create entirely new ones.
Usually, when you need to create a subroutine that returns different values
in different contexts (list, scalar, or void), you write something like:
sub get_server_status {
my ($server_ID) = @_;
# Acquire server data somehow...
my %server_data = _ascertain_server_status($server_ID);
# Return different components of that data,
# depending on call context...
if (wantarray()) {
return @server_data{ qw(name uptime load users) };
}
if (defined wantarray()) {
return $server_data{load};
}
if (!defined wantarray()) {
carp 'Useless use of get_server_status() in void context';
return;
}
else {
croak q{Bad context! No biscuit!};
}
}
That works okay, but the code could certainly be more readable. In its
simplest usage, this module makes that code more readable by providing
three subroutines--'LIST()', 'SCALAR()', 'VOID()'--that are true only when
the current subroutine is called in the corresponding context:
use Contextual::Return;
sub get_server_status {
my ($server_ID) = @_;
# Acquire server data somehow...
my %server_data = _ascertain_server_status($server_ID);
# Return different components of that data
# depending on call context...
if (LIST) { return @server_data{ qw(name uptime load users) } }
if (SCALAR) { return $server_data{load} }
if (VOID) { print "$server_data{load}\n" }
else { croak q{Bad context! No biscuit!} }
}
A simple implementation of the RC4 algorithm, developed by RSA Security, Inc.
Here is the description from RSA's website:
RC4 is a stream cipher designed by Rivest for RSA Data Security (now RSA
Security). It is a variable key-size stream cipher with byte-oriented
operations. The algorithm is based on the use of a random permutation. Analysis
shows that the period of the cipher is overwhelmingly likely to be greater than
10100. Eight to sixteen machine operations are required per output byte, and
the cipher can be expected to run very quickly in software. Independent
analysts have scrutinized the algorithm and it is considered secure.
Aliasing is the phenomenon where two different expressions actually refer
to the same thing. Modifying one will modify the other, and if you take a
reference to both, the two values are the same.
Aliasing occurs in Perl for example in for-loops and sub-calls:
for $var ($x) {
# here $var is an alias to $x
}
foo($y);
sub foo {
# here $_[0] is an alias to $y
}
Data::Alias is a module that allows you to apply "aliasing semantics" to a
section of code, causing aliases to be made whereever Perl would normally
make copies instead. You can use this to improve efficiency and
readability, when compared to using references.
The exact details of aliasing semantics are below under the /DETAILS
manpage.
Given a list of scalars or reference variables, writes out their contents in
perl syntax. The references can also be objects. The contents of each variable
is output using the least number of Perl statements as convenient, usually only
one. Self-referential structures, closures, and objects are output correctly.
The return value can be evaled to get back an identical copy of the original
reference structure. In some cases this may require the use of utility subs
that Data::Dump::Streamer will optionally export.
This module is very similar in concept to the core module Data::Dumper, with
the major differences being that this module is designed to output to a stream
instead of constructing its output in memory (trading speed for memory), and
that the traversal over the data structure is effectively breadth first versus
the depth first traversal done by the others.
In fact the data structure is scanned twice, first in breadth first mode to
perform structural analysis, and then in depth first mode to actually produce
the output, but obeying the depth relationships of the first pass.
When searching through large amounts of data, it is often the case that a
result set is returned that is larger than we want to display on one page.
This results in wanting to page through various pages of data. The maths
behind this is unfortunately fiddly, hence this module.
The main concept is that you pass in the number of total entries, the number
of entries per page, and the current page number. You can then call methods
to find out how many pages of information there are, and what number the
first and last entries on the current page really are.
Authors:
--------
James Laver
This module is a simple visitor implementation for Perl values.
It has a main dispatcher method, 'visit', which takes a single perl value
and then calls the methods appropriate for that value.
It can recursively map (cloning as necessary) or just traverse most
structures, with support for per object behavior, circular structures,
visiting tied structures, and all ref types (hashes, arrays, scalars, code,
globs).
the Data::Visitor manpage is meant to be subclassed, but also ships with a
callback driven subclass, the Data::Visitor::Callback manpage.
DateTime is a class for the representation of date/time combinations, and
is part of the Perl DateTime project. For details on this project please
see the http://datetime.perl.org/ manpage. The DateTime site has a FAQ
which may help answer many "how do I do X?" questions. The FAQ is at the
http://datetime.perl.org/wiki/datetime/page/FAQ manpage.
It represents the Gregorian calendar, extended backwards in time before its
creation (in 1582). This is sometimes known as the "proleptic Gregorian
calendar". In this calendar, the first day of the calendar (the epoch), is
the first day of year 1, which corresponds to the date which was
(incorrectly) believed to be the birth of Jesus Christ.
The calendar represented does have a year 0, and in that way differs from
how dates are often written using "BCE/CE" or "BC/AD".
For infinite datetimes, please see the DateTime::Infinite module.
Devel::Caller - meatier versions of caller.
Devel::Declare can install subroutines called declarators which locally
take over Perl's parser, allowing the creation of new syntax.
This document describes how to create a simple declarator.
Perl's global destruction is a little tricky to deal with WRT finalizers
because it's not ordered and objects can sometimes disappear.
Writing defensive destructors is hard and annoying, and usually if global
destruction is happenning you only need the destructors that free up non
process local resources to actually execute.
For these constructors you can avoid the mess by simply bailing out if
global destruction is in effect.
Devel::LexAlias provides the ability to alias a lexical variable in a
subroutines scope to one of your choosing.
This module is a data dumper optimized for logging of arbitrary
parameters.
This is an interactive shell for Perl, commonly known as a REPL - Read,
Evaluate, Print, Loop. The shell provides for rapid development or testing of
code without the need to create a temporary source code file.
Through a plugin system, many features are available on demand. You can also
tailor the environment through the use of profiles and run control files, for
example to pre-load certain Perl modules when working on a particular project.
String eval is often used for dynamic code generation. For instance,
'Moose' uses it heavily, to generate inlined versions of accessors and
constructors, which speeds code up at runtime by a significant amount.
String eval is not without its issues however - it's difficult to control
the scope it's used in (which determines which variables are in scope
inside the eval), and it can be quite slow, especially if doing a large
number of evals.
This module attempts to solve both of those problems. It provides an
'eval_closure' function, which evals a string in a clean environment, other
than a fixed list of specified variables. It also caches the result of the
eval, so that doing repeated evals of the same source, even with a
different environment, will be much faster (but note that the description
is part of the string to be evaled, so it must also be the same (or
non-existent) if caching is to work properly).
Perl extension for recursively copying files and directories.
File::Next is an iterator-based module for finding files. It's
lightweight, has no dependencies, runs under taint mode, and puts your
program more directly in control of file selection.
This module reads a file backwards line by line. It is simple to use, memory
efficient and fast. It supports both an object and a tied handle interface.
It is intended for processing log and other similar text files which typically
have their newest entries appended to them. By default files are assumed to be
plain text and have a line ending appropriate to the OS. But you can set the
input record separator string on a per file basis.
This module simply interpolates option file hints in @ARGV by the contents of
the pointed files. This enables option reading from files instead of or
additional to the usual reading from the command line.
Alternatively, you can process any array instead of @ARGV which is used by
default and mentioned mostly in this manual.
The interpolated @ARGV could be subsequently processed by the usual option
handling, e.g. by a Getopt::xxx module. Getopt::ArgvFile does not perform any
option handling itself, it only prepares the array @ARGV.
Similar to "List::MoreUtils", "Hash::MoreUtils" contains trivial but
commonly-used functionality for hashes.
HTTP::Lite is a stand-alone lightweight HTTP/1.1 implementation
for perl.
It is not intended as a replacement for the fully-features LWP module. Instead,
it is intended for use in situations where it is desirable to install the
minimal number of modules to achieve HTTP support, or where LWP is not a good
candidate due to CPU overhead, such as slower processors.
HTTP::Lite is also significantly faster than LWP.
HTTP::Lite is ideal for CGI (or mod_perl) programs or for bundling for
redistribution with larger packages where only HTTP GET and POST functionality
are necessary.
IO::All combines all of the best Perl IO modules into a single nifty
object oriented interface to greatly simplify your everyday Perl IO
idioms. It exports a single function called "io", which returns a new
IO::All object. And that object can do it all!
produce tied (and other) separate but combined variables
Lexical::Persistence does a few things, all related. Note that all the
behaviors listed here are the defaults. Subclasses can override nearly every
aspect of Lexical::Persistence's behavior.
Lexical::Persistence lets your code access persistent data through lexical
variables. This example prints "some value" because the value of $x perists in
the $lp object between setter() and getter().