A module that caches a data structure against a filename, statting the
file to determine whether it has changed and needs to be re-parsed.
You supply a routine to generate the data structure given the filename.
This module is recommended for files which change infrequently but
are read often, especially if they are expensive to parse.
This approach has the advantage over lazy caching that multiple
processes holding a cache will all update at the same time so you
will not get inconsistent results if you request data from different
processes.
The module itself is simply a factory for various backend modules.
The distribution includes backends for in-memory caching or file
caching using Storable, plus an adaptor to use any modules offering
the Cache or Cache::Cache interfaces as the cache implementation.
Data structures are automatically serialised/deserialised by the
backend modules if they are being persisted somewhere other than
in memory (e.g. on the filesystem).
ShowTable.pm, is a Perl 5 module which defines subroutines to print arrays
of data in a nicely formatted listing, using one of four possible formats:
simple table, boxed table, list style, and HTML-formatting (for
World-Wide-Web output). See the documentation on ShowTable.pm for details
on the formatting.
The program "showtable" reads data in a variety of formats from a file or
STDIN, optimally columnizes the data, and then feeds the array of data to
the ShowTable module for display. Showtable can parse its own output as
input (except for HTML). Individual or ranges of columns may be selected
for display, either by name or by index.
In other words, showtable is a data formatting program. Using the '-html'
option, showtable can accept ASCII tabular data and format it appropriately
for display through a Web-browser.
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).
This class implements a simple state machine pattern, allowing you to
quickly build rules-based state machines in Perl. As a simple
implementation of a powerful concept, it differs slightly from an ideal
DFA model in that it does not enforce a single possible switch from one
state to another. Rather, it short circuits the evaluation of the rules
for such switches, so that the first rule to return a true value will
trigger its switch and no other switch rules will be checked. (But see the
strict attribute and parameter to new().) It differs from an NFA model in
that it offers no back-tracking. But in truth, you can use it to build a
state machine that adheres to either model--hence the more generic FSA
moniker.
Pit is a command-line project manager that integrates with Git.
Basic Pit entities are projects, tasks, and notes. One project
can have multiple tasks, and a task can have multiple notes.
Each entity has a number of attributes. For example, project
has name and status, task has name, status, priority, date, and
time, and within note there is message body. All attributes
except name and message body are optional and can be omitted.
The attributes have no semantic meaning, and do not have a
pre-defined set of values. For example, depending on the
particular need, the time attribute could be used as projected
time in weeks, hours spent on the task, or days left to finish
the task.
Pit tries to maintain a notion of "current" project, task, or
note. When you create new project, it automatically becomes
current. If you do not specify project number when creating a
task, the new task will be associated with the current project.
This module is meant to be the definitive implementation of iterators, as
popularized by Mark Jason Dominus's lectures and recent book (Higher Order
Perl, Morgan Kauffman, 2005).
An "iterator" is an object, represented as a code block that generates the
"next value" of a sequence, and generally implemented as a closure. When
you need a value to operate on, you pull it from the iterator. If it
depends on other iterators, it pulls values from them when it needs to.
Iterators can be chained together (see Iterator::Util for functions that
help you do just that), queuing up work to be done but not actually doing
it until a value is needed at the front end of the chain. At that time,
one data value is pulled through the chain.
Iterator.pm provides a class that simplifies creation and use of these
iterator objects. Other Iterator:: modules (see "SEE ALSO") provide many
general-purpose and special-purpose iterator functions.
There's a whole bunch of class builders out there. In fact, creating a
class builder seems to be something of a rite of passage (this is my
fifth, at least).
Unfortunately, most of the time I want a class builder I'm in a hurry
and sketching out lots of fairly simple data classes with fairly
simple structure, mostly just read-only accessors, and that's about it.
Often this is for code that won't end up on CPAN, so adding a small
dependency doesn't matter much. I just want to be able to define these
classes FAST.
By which I mean LESS typing than writing them by hand, not more. And I
don't need all those weird complex features that bloat out the code
and take over the whole way I build modules.
And so, I present yet another member of the Tiny family of modules,
Object::Tiny.
This is a sister module of Parse::PMFile. This module parses local
.pm files (and a META file if any) in a specific (current if not
specified) directory, and returns a hash reference that represents
"provides" information (with some extra meta data). This is almost
the same as Module::Metadata does (which has been in Perl core since
Perl 5.13.9). The main difference is the most of the code of this
module is directly taken from the PAUSE code as of June 2013. If you
need better compatibility to PAUSE, try this. If you need better
performance, safety, or portability in general, Module::Metadata may
be a better and handier option (Parse::PMFile (and thus
Parse::LocalDistribution) actually evaluates code in the $VERSION line
(in a Safe compartment), which may be problematic in some cases).
This module is a first crack at providing a consistent interface to
Unix (and maybe other multitasking OS's) process table information.
The impetus for this came about with my frustration at having to parse
the output of various systems' ps commands to check whether specific
processes were running on different boxes at a large mixed Unix site.
The output format of ps was different on each OS, and sometimes
changed with each new release of an OS. Also, running a ps subprocess
from within a perl or shell script and parsing the output was not a
very efficient or aesthetic way to do things.
With this module, you can do things like this:
# kill memory pigs
use Proc::ProcessTable;
$t = new Proc::ProcessTable;
foreach $p ( @{$t->table} ){
if( $p->pctmem > 95 ){
$p->kill(9);
}
}
Since Perl allows us to provide a subroutine reference or a method name to the
-> operator when used as a method call, and a subroutine doesn't require the
invocant to actually be an object, we can create safe versions of isa, can and
friends by using a subroutine reference that only tries to call the method if
it's used on an object.
e.g. my $isa_Foo = $maybe_an_object->$_call_if_object(isa => 'Foo');
Note that we don't handle trying class names, because many things are valid
class names that you might not want to treat as one (like say "Matt") - the
is_module_name function from Module::Runtime is a good way to check for
something you might be able to call methods on if you want to do that.