HTTP::...ecords(3pm)
π HTTP::OAI::ListRecords β the whole vibe π
okay so bestie, welcome to the manual page for HTTP::OAI::ListRecords, part of the User Contributed Perl Documentation. It's giving OAI realness β specifically, it's the thing that hands you access to an OAI ListRecords response. Yes. That one. π
β¨ NAME β¨
HTTP::OAI::ListRecords β bestie, it provides access to an OAI ListRecords response. That's the whole job. She's focused. She's booked. π
πΈ SYNOPSIS πΈ
So here's how you actually use her. First up, the classic loop-it-yourself moment:
my $r = $h->ListRecords(
metadataPrefix=>'oai_dc',
);
while( my $rec = $r->next ) {
print "Identifier => ", $rec->identifier, "\n";
}
die $r->message if $r->is_error;
not the die at the end being the most important line in the whole file π check your errors, bestie, she's begging you.
And then there's the callback method, for when you're feeling β¨extraβ¨:
# Using callback method
sub callback {
my $rec = shift;
print "Identifier => ", $rec->identifier, "\n";
};
my $r = $h->ListRecords(
metadataPrefix=>'oai_dc',
onRecord=>\&callback
);
die $r->message if $r->is_error;
Same energy, different delivery. Callback girlies, this one's for you. π¦
π METHODS π
π«Ά $lr = new HTTP::OAI::ListRecords
This constructor method returns a new HTTP::OAI::ListRecords object. That's it. That's the method. Fresh object, fresh start, main character energy. β¨
π $rec = $lr->next
Returns either an HTTP::OAI::Record object, or undef if no more records are available. And listen β use $rec->is_error to test whether there was an error getting the next record. Don't just assume the undef means "all done", because it might be screaming at you. π
π @recl = $lr->record([$rec])
Returns the record list, and optionally adds a new record or resumptionToken, $rec. Returns an array ref of HTTP::OAI::Records, including an optional resumptionToken string. Two jobs, one method, we love a multitasker.
π $token = $lr->resumptionToken([$token])
Returns and optionally sets the HTTP::OAI::ResumptionToken. Give her a token and she'll set it; give her nothing and she'll hand you one. get you a method that can do both π
β $dom = $lr->toDOM
Returns a XML::DOM object representing the ListRecords response. Boom. DOM'd. π
quick reminder bestie: every one of these is a method on the object, so call them on $lr and not on the class. she's an instance girlie. π
and that's the whole page, no cap. this was HTTP::...ecords(3pm) from the User Contributed Perl Documentation, running on perl v5.36.0, dated 2023-09-28. slay, hydrate, check your is_error, bye bestie πβ¨
π¦ where this page comes from
- debian trixie: libhttp-oai-perl 4.13-1 Β· BSD-3-Clause
- ubuntu noble: libhttp-oai-perl 4.13-1 Β· BSD-3-Clause
- ubuntu resolute: libhttp-oai-perl 4.13-1 Β· BSD-3-Clause
- ubuntu stonking: libhttp-oai-perl 4.13-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms