Catman...RCMaker(3pm)

πŸ“¦
version 1.320 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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 an IO::Handle. If you don't set this one, Catmandu::Util::io steps in and builds the output handle for you, either from the "file" argument or by just using STDOUT. 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 stream fh. 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