Biblio::COUNTER::Processor::Atomize - break a COUNTER report into itsy pieces
use Biblio::COUNTER::Processor::Atomize; $processor = Biblio::COUNTER::Processor::Atomize->new; $report = $processor->run($file_or_filehandle);
Biblio::COUNTER::Processor::Atomize breaks a COUNTER report into tiny pieces (figuratively speaking) and executes a callback for each valid usage number it finds.
The callback function should look something like this:
sub my_callback { my %data = @_; $title = $data{title}; $count = $data{count}; $metric = $data{metric}; $period = $data{period}; # etc. }
The following elements may appear in the hash passed to the callback function:
The short code that indicates the type of the report (e.g., JR1 or DB3).
JR1
DB3
The name of the file containing the report. Set to - if processing standard input.
-
The Biblio::COUNTER::Processor::Atomize instance.
The instance of the appropriate subclass of Biblio::COUNTER::Report
A string of the form YYYY-mm denoting the period in question.
The type of event counted (requests, sessions, searches, or turnaways).
requests
sessions
searches
turnaways
The count itself. The callback is not executed for a blank or invalid count.
The platform on which the resource was provided.
The resource title.
The resource's publisher. May be the empty string.
The journal's print ISSN.
The journal's online ISSN.
The book's ISBN.
$foo = Biblio::COUNTER::Processor::Atomize->new;
%args is a list of (key, value) pairs. The only key that means anything is callback; the value associated with it is a reference to the desired callback function.
The desired callback function prints (to standard output) a single tab-delimited line for each datum, with a header. Each line of output has the following elements, in the order listed:
$report = $processor->run($what);
Process the given report.
$what may be a file handle, the name of a file, or an instance of (a subclass of) Biblio::COUNTER::Report.
Biblio::COUNTER::Processor::Atomize is designed to be inheritable.
There are no known bugs. Please report bugs to the author via e-mail (see below).
Paul Hoffman (nkuitse AT cpan DOT org)
Copyright 2008 Paul M. Hoffman.
This is free software, and is made available under the same terms as Perl itself.
Biblio::COUNTER
Biblio::COUNTER::Report
Biblio::COUNTER::Report::Processor
To install Biblio::COUNTER, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Biblio::COUNTER
CPAN shell
perl -MCPAN -e shell install Biblio::COUNTER
For more information on module installation, please visit the detailed CPAN module installation guide.