SRU::Server(3pm)
π SRU::Server π
okay bestie, gather round, because we're talking about SRU::Server β a Perl module from the SRU::Server(3pm) manual page, living in User Contributed Perl Documentation. it does the absolute most in the best way: it lets you respond to SRU requests via CGI::Application, and honestly? iconic. β¨
π SYNOPSIS π
package MySRU;
use base qw( SRU::Server );
sub explain {
my $self = shift;
# $self->request isa SRU::Request::Explain
# $self->response isa SRU::Response::Explain
}
sub scan {
my $self = shift;
# $self->request isa SRU::Request::Scan
# $self->response isa SRU::Response::Scan
# $self->cql is the root node of a CQL::Parser-parsed query
}
sub searchRetrieve {
my $self = shift;
# $self->request isa SRU::Request::SearchRetrieve
# $self->response isa SRU::Response::SearchRetrieve
# $self->cql is the root node of a CQL::Parser-parsed query
}
package main;
MySRU->new->run;
π¦ DESCRIPTION π¦
so the whole vibe here is: this module gathers up all of the SRU verbs β explain, scan and searchRetrieve β and puts them together under one sub-classable object based on CGI::Application. that's it, that's the serve. π
π METHODS π
πΈ explain
this method is what you use to return an explain response. and plot twist: it's also the default method. main character energy fr fr π
πΈ scan
this method returns a scan response. slay.
πΈ searchRetrieve
this method returns a searchRetrieve response. no cap. π«Ά
β¨ CGI::APPLICATION METHODS β¨
π setup
sets the run_modes, mode_param and the default runmode (explain). lowkey doing a lot of heavy lifting here.
π cgiapp_prerun
parses the incoming SRU request and, if needed, checks the CQL query. iykyk.
π cgiapp_postrun
sets the content type (text/xml) and serializes the response. periodt. π₯
π error_mode
stub error runmode. it's giving "placeholder but make it valid". π
π AUTHORS π
- Brian Cassidy
<bricas@cpan.org> - Ed Summers
<ehs@pobox.com> - Jakob Voss
<voss@gbv.de>
three absolute legends, we stan. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2013 by Ed Summers.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
so basically: go off, remix it, redistribute it β same terms as Perl 5 itself. legal slay. βοΈβ¨
and that's the whole page bestie, no notes π this was SRU::Server(3pm), generated by perl v5.34.0, dated 2022-06-17. mwah, love u, go write some SRU responses π§ββοΈπ
π¦ where this page comes from
- debian bookworm: libsru-perl 1.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libsru-perl 1.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libsru-perl 1.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsru-perl 1.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsru-perl 1.01-3 Β· 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