ClearPress::util - A database handle and utility object
$LastChangedRevision: 12 $
my $oUtil = ClearPress::util->new({ 'configpath' => '/path/to/config.ini', # Optional });
my $sPath = $oUtil->data_path();
$oUtil->configpath('/path/to/configfile/'); my $sConfigPath = $oUtil->configpath();
my $oConfig = $oUtil->config();
my $oDbh = $oUtil->dbh();
my $sQuoted = $oUtil->quote($sUnquoted);
Example: A cascade of object saving $util->transactions(0); # disable transactions for my $subthing (@{$thing->subthings()}) { # cascade object saves (without commits) $subthing->save(); } $util->transactions(1); # re-enable transactions $thing->save(); # save parent object (with commit)
$oUtil->username((getpwuid $<)[0]); $oUtil->username($sw->username()); my $sUsername = $oUtil->username();
$oUtil->cgi($oCGI); my $oCGI = $oUtil->cgi();
$oUtil->profiler($oProfiler); my $oProf = $oUtil->profiler();
This is usually used for testing group membership for authorisation checks my $oRequestingUser = $oUtil->requestor();
DBI Config::IniFiles
Roger Pettett, <rpettett@cpan.org>
Copyright (C) 2007 Roger Pettett
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.
To install ClearPress, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ClearPress
CPAN shell
perl -MCPAN -e shell install ClearPress
For more information on module installation, please visit the detailed CPAN module installation guide.