Catman...RCMaker(3pm)
π Catman...RCMaker(3pm) β ok so bestie, we're reading the user-contributed Perl docs π
Hiiii so this is Catman...RCMaker(3pm) from the User Contributed Perl Documentation, and it's literally the glow-up guide for turning MARC records into USMARC. Buckle up, it's giving niche-but-iconic π
β¨ NAME β¨
Catmandu::Exporter::MARC::MARCMaker β the exporter that takes your MARC records and writes them out as USMARC. That's it, that's the whole job, and it does it flawlessly π
π SYNOPSIS π
Ok so here's how you actually use it. First, from the command line, and yes you just pipe it, no big deal:
# From the command line
$ catmandu convert MARC --type XML to MARC --type MARCMaker < /foo/data.mrc
And if you're a Perl girlie (respect π«Ά), you do it like this:
# From Perl
use Catmandu;
my $importer = Catmandu->importer('MARC', file => "/foo/bar.mrc" , type => 'XML');
my $exporter = Catmandu->exporter('MARC', file => "marc.xml", type => 'MARCMaker' );
$exporter->add($importer);
$exporter->commit;
See how the importer eats the file and the exporter writes it out? Chef's kiss. The add slurps everything in, and commit makes it official. Periodt β¨
π CONFIGURATION π
These are the knobs you get to turn. Every single one, no skips:
fileβ writes the output to a local file, and you give it either a path or a file handle. Feeling spicy? You can also pass a scalar reference and it'll write into a string instead, or a code reference and it'll fire off a callback function. Versatile queen πfhβ writes the output straight to anIO::Handle. If you don't set this one,Catmandu::Util::iosteps in and builds the output handle for you, either from the"file"argument or by just usingSTDOUT. Lowkey convenient.fixβ an ARRAY (yes, an array, plural vibes) of one or more fixes or file scripts that get applied to the exported items. Glow-up filter for your data π§encodingβ this is the binmode of the output streamfh. Defaults to":utf8"and honestly? iconic choice.
π METHODS π
There are more methods than I can list here, and I'm not about to make stuff up. For the full menu, go look at Catmandu::Exporter, Catmandu::Addable, Catmandu::Fixable, Catmandu::Counter, and Catmandu::Logger. They've got the whole lineup, iykyk π
π¦ SEE ALSO π¦
Catmandu::Exporter
Real talk for one sec: this page only documents what's written here β no extra tips, no guessing at behaviour. If it's not in the list above, I'm not claiming it, bestie π
And that's the whole page!! This one was written for perl v5.38.2 and dated 2024-08-03, so that's the vibe and the version, mwah πβ¨ Go export something cute πΈ
π¦ where this page comes from
- debian trixie: libcatmandu-marc-perl 1.320-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatmandu-marc-perl 1.320-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-marc-perl 1.320-1 Β· 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