Catman...:Parser(3pm)

πŸ“¦
version 0.43.0 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Catmandu::Importer::SRU::Parser πŸ’–

okay bestie, welcome to the glow-up page for Catmandu::Importer::SRU::Parser, straight out of the User Contributed Perl Documentation section of the manual (3pm, iykyk). this one's short but it's mighty 🫢


✨ NAME ✨

Catmandu::Importer::SRU::Parser β€” the package that transforms SRU responses into Perl, no cap πŸ¦‹


🌸 SYNOPSIS 🌸

package MyParser;

use Moo;

sub parse {
      my ($self,$record) = @_;
      my $schema  = $record->{recordSchema};
      my $packing = $record->{recordPacking};
      my $data    = $record->{recordData};

      ... do some magic...

      return $perl_hash;
}

like… look at her. Moo, a parse sub, and then magic ✨ (the magic is you, you're the magic πŸ’…).


πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea β˜• Catmandu::Importer::SRU can optionally include a parser to transform the returned records from SRU requests. that's it, that's the whole vibe β€” optional but iconic πŸ‘‘

and literally any parser you plug in has to implement one instance method: parse 🧚

that method gets an SRU-record handed to it, and it hands back a perl hash. simple. elegant. main character energy 🌈

ngl bestie, that's the whole contract: one method in, one hash out. don't overthink it πŸ’œ

πŸ‘‘ AUTHOR πŸ‘‘

Patrick Hochstenbach, <patrick.hochstenbach at ugent.be> β€” an actual legend, we stan πŸ“


πŸ’« that's a wrap πŸ’«

this page was living in perl v5.38.2, dated 2021-09-02, and honestly? she ate. periodt πŸ’…βœ¨

bye bestie, go parse something gorgeous πŸ’–πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from