Biblio...Atomize(3pm)
π NAME π
Biblio::COUNTER::Processor::Atomize β it breaks a COUNTER report into itsy pieces π¦ (this is the Biblio...Atomize(3pm) page, in case you were wondering, bestie, it's from the User Contributed Perl Documentation)
β¨ SYNOPSIS β¨
use Biblio::COUNTER::Processor::Atomize;
$processor = Biblio::COUNTER::Processor::Atomize->new;
$report = $processor->run($file_or_filehandle);
πΈ DESCRIPTION πΈ
So Biblio::COUNTER::Processor::Atomize takes a COUNTER report and shatters it into tiny little pieces (figuratively speaking, ok, the report is not actually in shambles π) and then it runs a callback for every valid usage number it finds. It's giving demolition but make it data. Obsessed.
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:
codeβ the short code that tells you what kind of report this is (like"JR1"or"DB3"). Iykyk.fileβ the name of the file that's holding the report. Set to"-"if you're processing standard input. π«Άprocessorβ theBiblio::COUNTER::Processor::Atomizeinstance itself. Main character is present.reportβ the instance of the appropriate subclass ofBiblio::COUNTER::Reportperiodβ a string of the formYYYY-mmthat denotes the period in question. β¨metricβ the type of event that got counted ("requests","sessions","searches", or"turnaways").countβ the count itself. Heads up: the callback is not executed for a blank or invalid count. No fake numbers here, periodt.platformβ the platform on which the resource was provided.titleβ the resource title.publisherβ the resource's publisher. May be the empty string. It's allowed to have nothing to say. πprint_issn(journal reports only) β the journal's print ISSN.online_issn(journal reports only) β the journal's online ISSN.isbn(book reports only) β the book's ISBN.
π PUBLIC METHODS π
π new(%args)
$foo = Biblio::COUNTER::Processor::Atomize->new;
%args is a list of (key, value) pairs. The only key that actually means anything is callback; the value you pair with it is a reference to the callback function you want. Everything else? Not it. Ignored. π
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:
codefileplatformperiodmetriccounttitlepublisherprint_issn(journal reports only)online_issn(journal reports only)isbn(book reports only)
π¦ run($file)
$report = $processor->run($what);
Process the given report. That's it, that's the job. β¨
$what may be a file handle, the name of a file, or an instance of (a subclass of) Biblio::COUNTER::Report. So many options, so little time.
π INHERITANCE π
Biblio::COUNTER::Processor::Atomize is designed to be inheritable. Pass the genes down, bestie, it's generational. π§¬
π BUGS π
There are no known bugs. (No cap, apparently we ate and left no crumbs.) Please report bugs to the author via e-mail (see below). π
π AUTHOR π
Paul Hoffman (nkuitse AT cpan DOT org)
π COPYRIGHT π
Copyright 2008 Paul M. Hoffman.
This is free software, and is made available under the same terms as Perl itself. Slay.
π₯ SEE ALSO π₯
Biblio::COUNTERBiblio::COUNTER::ReportBiblio::COUNTER::Report::Processor
k bye bestie, this page was brought to you by perl v5.36.0, dated 2023-02-04 β go atomize something cute πβ¨
π¦ where this page comes from
- debian bookworm: libbiblio-counter-perl 0.11-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbiblio-counter-perl 0.11-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbiblio-counter-perl 0.11-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbiblio-counter-perl 0.11-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libbiblio-counter-perl 0.11-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms