NAME
Sys::Config::Manage::Scripts - Allows scripts to be stored specifically for a configuration directory.
VERSION
Version 0.1.0
SYNOPSIS
use Sys::Config::Manage::Scripts;
my $foo = Sys::Config::Manage::Scripts->new();
...
METHODS
new
$foo=Sys::Config::Manage::Perms->new(\%args);
if($foo->error){
warn('error:'.$foo->error.': '.$foo->errorString);
}
editScript
getScript
This returns the contents of the specified script.
Two arguments are taken. The first and optional one is the configuration directory, which if not specified it will be automatically choosen. The second and required is the script name.
my $data=$foo->getScript( $configDir, $script );
if($foo->error){
warn('error:'.$foo->error.': '.$foo->errorString);
}
listScripts
This lists the scripts for the configuration directory in question.
my @scripts=$foo->listScripts($configDir);
if ( $foo->error ){
warn('Error:'.$foo->error.': '.$foo->errorString);
}
scriptExists
This verifies that the script in question exists.
Two arguments are taken. The first is the configuration directory and if not specified it will be choosen automatically. The second is the script name.
my $exists=$foo->scriptExists($configDir, $script);
if( $foo->error ){
warn('Error:'.$foo->error.': '.$foo->errorString);
}else{
if( $exists ){
print "It exists\n";
}else
print "It does not exists\n";
}
}
readScript
This reads a script and returns it's contents.
The arguments are taken. The fist is the name of the configuration directory and it not specified it will be automarically choosen. The second is the script name.
my $contents=$foo->readScript( $configDir, $script );
if( $foo->error ){
warn('Error:'.$foo->error.': '.$foo->errorString);
}
runScript
This executes the via system.
The arguments are taken. The fist is the name of the configuration directory and it not specified it will be automarically choosen. The second is the script name.
my $exit=$foo->runScript($configDir, $script);
if( $foo->error ){
warn('Error:'.$foo->error.': '.$foo->errorString);
}
writeScript
This writes a script. If it does not exist, it will be created.
Three arguments are taken. The first is the configuration directory, the second is the script name, and the third is the contents of the script.
If the configuration directory is not specified, it will be automaticaly choosen.
$foo->writeScript($configDir, $scriptName, $scriptContents);
if( $foo->error ){
warn('Error:'.$foo->error.': '.$foo->errorString);
}
ERROR CODES
1
Nothing passed for the Sys::Config::Manage object.
2
$args{scm} is not a Sys::Config::Manage object.
3
Sys::Config::Manage errored.
4
Invalid configuration directory name.
5
The specified configuration directory does not exist.
6
Unable to open the script directory.
7
No script specified.
8
No script data specified.
9
Unable to create a required directory.
10
The script name contains a '/'.
11
Could not open the script.
12
The script does not exist.
AUTHOR
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
BUGS
Please report any bugs or feature requests to bug-sys-config-manage-perms at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sys-Config-Manage-Perms. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Sys::Config::Manage::Perms
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
Copyright 2011 Zane C. Bowers-Hadley.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.