Register::System - Implementation of the Win32 registry in Unix
use Register; $sysreg=new Register::System ( 'regpath' => "/etc", 'regname' => "SYSREG" ); $sysreg->savesettings("APPLICATION","SECTION","KEY","VALUE"); $value=$sysreg->getsettings("APPLICATION","SECTION","KEY"); $sysreg->deletesettings("APPLICATION","SECTION","KEY"); $sysreg->deletesection("APPLICATION","SECTION");
The Register::System module permit to create a registry file like Windows for save global information about your program. With the use of CSV dbd , the file created is readable by DBI without problem. Here CSV table specifics:
FIELD_NAME FIELD_TYPE ---------------------------------- R_APPLICATION CHAR R_SECTION CHAR R_KEY CHAR R_VALUE CHAR
The <new> statament create the Register::System object and return the reference to him.
$sysreg=new Register::System ( 'regpath' => "/etc", 'regname' => "SYSREG" );
Parameter :
regpath specify the path where new statament search for registers. regname specify the name of the register to use.
Finaly if regpath don't exist the program return an error message at compile time, if the register don't exist it is maked.
The savesettings function , save the value argument in the key of the section of the program.
$sysreg->savesettings("APPLICATION","SECTION","KEY","VALUE");
If the key don't exist it make (it make also application and section without specify befor), else if key already exist and value is different from previous it update value.
The getsettings function retrieve the value of the specified key.
$value=$sysreg->getsettings("APPLICATION","SECTION","KEY");
The deletesettings function delete the entry key specified.
$sysreg->deletesettings("APPLICATION","SECTION","KEY");
The deletesection function delete the entry section specified.
$sysreg->deletesection("APPLICATION","SECTION");
Vecchio Fabrizio <jacote@tiscalinet.in>
Register,DBD::CSV,DBI
To install Register, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Register
CPAN shell
perl -MCPAN -e shell install Register
For more information on module installation, please visit the detailed CPAN module installation guide.