A system for choosing a value for something. Takes a string composed of various
tests, arguements, and etc and returns a value based on it.
This module is designed to provide an extremely lightweight way to parse
moderately complex configuration files. As such, it exports a single
function - fastconfig() - and does not provide any OO access methods.
Still, it is fairly full-featured.
Here's how it works:
%cf = fastconfig($file, $delim);
Basically, the fastconfig() function returns a hash of keys and values
based on the directives in your configuration file. By default, directives
and values are separated by whitespace in the config file, but this can be
easily changed with the delimiter argument (see below).
When the configuration file is read, its modification time is first
checked and the results cached. On each call to fastconfig(), if the
config file has been changed, then the file is reread. Otherwise, the
cached results are returned automatically. This makes this module great
for mod_perl modules and scripts, one of the primary reasons I wrote it.
Simply include this at the top of your script or inside of your
constructor function:
my %cf = fastconfig('/path/to/config/file.conf');
If the file argument is omitted, then fastconfig() looks for a file named
$0.conf in the ../etc directory relative to the executable. For example,
if you ran:
/usr/local/bin/myapp
Then fastconfig() will automatically look for:
/usr/local/etc/myapp.conf
This is great if you're really lazy and always in a hurry, like I am.
If this doesn't work for you, simply supply a filename manually. Note that
filename generation does not work in mod_perl, so you'll need to supply a
filename manually.
Checks for dir/file addition/removals in the current directory.
Devel::TraceUse - Show the modules your program loads, recursively.
An apparently simple program may load a lot of modules. That's useful, but
sometimes you may wonder exactly which part of your program loads which module.
Devel::TraceUse can analyze a program to see which part used which module.
File::DirSync will make two directories exactly the same. The goal
is to perform this synchronization process as quickly as possible
with as few stats and reads and writes as possible. It usually can
perform the synchronization process within a few milliseconds - even
for gigabytes or more of information.
The File::Grep module is designed for find matches to a pattern in
a series of files and related functions.
IO::Null
========
Calling a constructor of this class always succeeds, returning a new
null filehandle. Writing to any object of this class is always a no-
operation, and returns true. Reading from any object of this class is
always nooperation, and returns empty-string or empty-list, as
appropriate.
IPC::Signal - Utility functions dealing with signals
This module contains utility functions for dealing with signals.
Normally if a part of a pipe fails, depending on the location, it won't
be detected. This breaks down a command involving pipes and runs each
command separately.
It uses open3 to run each chunk of the pipe.
use IO::MultiPipe;
my $pipes = IO::MultiPipe->new();
#This sets the pipe that will be run.
$pipes->set('sed s/-// | sed s/123/abc/ | sed s/ABC/abc/');
if ($pipes->{error}){
print "Error!\n";
}
#'123-ABCxyz' through the command set above.
my $returned=$pipes->run('123-ABCxyz');