NAME
Wikileaks::AfWD - Useful utilities for searching the Afganistan War Diary.
VERSION
Version 0.1.0
SYNOPSIS
use Wikileaks::AfWD;
my $foo = Wikileaks::AfWD->new();
...
METHODS
new
This initiates the object.
It takes a optional hash reference.
hash ref
If both "dbb" and "dbhCS" is specified, "dbi" will be used.
If none are specified, it checks for envriromental variables.
dbi
This is the DBH to use.
dbiCS
This is the DBI connection string to use.
dbiUser
If using "dbhCS", this will be checked for the user name to use.
If not specified, it will be set to "".
dbiPass
If using "dbhCS", this will be checked for the password to use.
If not specified, it will be set to "".
table
This is the table to search.
If not specified, "war_diary" is used.
search
This performs a search. This searches the table, specified in new, and returns the resutls.
One arguement is taken and is appended to the select statement.
For example if we wish to select every report where the dcolor is "BLUE", we would set it to "dcolor='BLUE'", making the resulting string "SELECT * FROM war_diary WHERE dcolor='BLUE';".
What is returned is the resulting statement handle, post execute.
my $sth=$foo->search($WHERE);
format
This formats the statement handler from the search method.
args hash ref
joiner
This is what should be used to join the entries.
The default is "\n\n---------------------------------------------------------------------------\n\n".
If defined, it will be printed and '' will be returned.
sth
This is the statement handler to use. Generally what is returned from the search method.
template
This is the Text::NeatTemplate to use.
ERROR RELATED METHODS
error
This returns the current error code if one is set. If undef/evaulates as false then no error is present. Other wise one is.
if($foo->error){
warn('error '.$foo->error.': '.$foo->errorString);
}
errorString
This returns the current error string. A return of "" means no error is present.
my $errorString=$foo->errorString;
errorblank
This blanks the error storage and is only meant for internal usage.
It does the following.
$self->{error}=undef;
$self->{errorString}="";
ERROR CODES
The error code is contianed in $foo->{error} and a extended description can be found in $foo->{errorString}. If any module ever sets $foo->{perror} then the error is permanent and none of the methods are usable.
1
The database handle passed is not a "DBI::db" object.
2
Failed to create the DBI connection.
3
No statement handle passed.
ENVIRONMENTAL VARIABLES
AfWD_DBICS
If neither "dbiCS" or "dbh" is specified for the new method, this will be used.
AfWD_DBIUSER
This if $ENV{AfWD_DBICS} is used, this will be checked for the user.
AfWD_DBIPASS
This if $ENV{AfWD_DBICS} is used, this will be checked for the password.
AUTHOR
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
BUGS
Please report any bugs or feature requests to bug-dbi-wikileaks-afwd at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Wikileaks-AfWD. 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 Wikileaks::AfWD
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.