MHArc::Util - General utilities for mail archiving system. |
MHArc::Util - General utilities for mail archiving system.
use MHArc::Util;
This module contains a collection of utility routines.
The following module variables can be set to affect the behavior of the utility routines:
$ECHO_CMDS
If set to a true value, any routines that execute shell commands, or external programs, will print the command to be executed to the default filehandle.
The default value for $ECHO_CMDS
is 0.
$ECHO_ONLY
If set to a true value, any routines that execute shell commands,
will only print the command to be executed to the default filehandle
if $ECHO_CMDS
is true. The command itself will not be
executed at all.
The default value for $ECHO_ONLY
is 0.
By default, no routines are exported into the calling namespace.
Routines in this module can be imported by explicitly listing the
routines to import in the use
declaration:
use MHArc::Util qw( run_prg );
The following routines are availale:
ch_dir($dir)
Change the current working directory.
cmd(LIST)
Execute external program. The return value is the wait(2)
status
of the program invoked.
mk_dir($dir, $mask)
Create specified directory. $mask
is optional, and if
not specified, will default to 0777
.
run_prg(LIST)
Execute external program and terminate process if program returns a non-zero status.
usage($verbosity)
Display usage information of program based upon embedded POD.
The $verbosity
argument has the same meaning as the -verbose
option to Pod::Usage::pod2usage
.
$Id: Util.pm,v 1.5 2002/09/13 07:24:18 ehood Exp $
Earl Hood, earl@earlhood.com
This module is part of the mharc archiving system and comes with ABSOLUTELY NO WARRANTY and may be copied only under the terms of the GNU General Public License, which may be found in the mharc distribution.
MHArc::Util - General utilities for mail archiving system. |