Catman...RCMaker(3pm)

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

πŸ’– Catmandu::Importer::MARC::MARCMaker πŸ’–

okay bestie, sit down, because this is the Catmandu::Importer::MARC::MARCMaker page from the 3pm manual and it's literally the package that imports MARCMaker records. that's the whole vibe. it imports MARCMaker records. iconic behavior honestly.


✨ NAME ✨

Catmandu::Importer::MARC::MARCMaker β€” the package that imports MARCMaker records πŸŽ€


🌸 SYNOPSIS 🌸

here's how you use her. from the command line, she said:

# From the command line
$ catmandu convert MARC --type MARCMaker --fix "marc_map('245a','title')" < /foo/data.mrk

and from perl, because of course:

# From perl
use Catmandu;

# import records from file
my $importer = Catmandu->importer('MARC',file => '/foo/data.mrk', type => 'MARCMaker');
my $fixer    = Catmandu->fixer("marc_map('245a','title')");

$importer->each(sub {
    my $item = shift;
    ...
});

# or using the fixer

$fixer->fix($importer)->each(sub {
    my $item = shift;
    printf "title: %s\n" , $item->{title};
});
not me copying that verbatim because you do NOT want me paraphrasing code, bestie. run it as-is. 🫢

πŸ¦‹ CONFIGURATION πŸ¦‹

these are the lil knobs you can turn. every single one, no skipping:

  • id β€” the MARC field that's holding the system id. default is 001. that's her home base πŸ’…
  • file β€” read your input from a local file, and you give her the path. OR, plot twist, you can hand her a scalar reference and she'll read from a string instead. versatile queen ✨
  • fh β€” read your input from an IO::Handle. if you don't specify one, Catmandu::Util::io rolls up and creates the input stream for you, either from the "file" argument or straight from STDIN. she improvises. πŸ‘‘
  • encoding β€” the binmode of the input stream fh. defaults to ":utf8" because we're not animals. 🧚
  • fix β€” an ARRAY of one or more fixes or file scripts that get applied to the imported items. stack 'em up, bestie πŸ“

πŸ’œ METHODS πŸ’œ

every Catmandu::Importer is a Catmandu::Iterable, which means all its methods are inherited. so like… she comes with the whole friend group already. no cap. 🌈


⭐ SEE ALSO ⭐

go read these next, they're the co-stars:

  • Catmandu::Importer
  • Catmandu::Iterable

this page ships with perl v5.38.2, dated 2024-08-03 β€” and that's the whole manual, bestie. go import some MARCMaker records, slay, and don't forget to hydrate. mwah πŸ’–πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from