Catman...croLIF(3pm)

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

πŸ’… Catmandu::Importer::MARC::MicroLIF πŸ’…

okay bestie, so this is a Perl module from the User Contributed Perl Documentation collection β€” it lives in the Catmandu::Importer::MARC::MicroLIF era of your life, and its whole job is importing MicroLIF records. that's it. that's the vibe. πŸŽ€


✨ NAME ✨

Catmandu::Importer::MARC::MicroLIF β€” the Package that imports MicroLIF records. no cap, that's literally its whole personality and it ate. πŸ‘‘


🌸 SYNOPSIS 🌸

so you can run this from the command line, like this:

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

or from perl, if that's more your main character energy:

# From perl
use Catmandu;

# import records from file
my $importer = Catmandu->importer('MARC',file => '/foo/data.lif', type => 'MicroLIF');
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};
});

see how the $fixer just glides in there at the end? obsessed. πŸ¦‹


πŸŽ€ CONFIGURATION πŸŽ€

  • id β€” the MARC field that holds the system id. default is 001. she's the identifier field, the moment, the blueprint. πŸ’…
  • file β€” read your input from a local file, and you give it the path. alternatively, you can pass a scalar reference and it'll read from a string instead. flexible fr fr. ✨
  • fh β€” read your input from an IO::Handle. if you don't specify one, Catmandu::Util::io gets used to build the input stream from the file argument, or by using STDIN. 🫢
  • encoding β€” the binmode of the input stream fh. it's set to :utf8 by default. we stay encoded, we stay iconic. 🌈
  • fix β€” an ARRAY of one or more fixes, or file scripts, that get applied to the imported items. throw your whole fixer stack in here, bestie. πŸ“

πŸ’– METHODS πŸ’–

every Catmandu::Importer is a Catmandu::Iterable, so all its methods are inherited. you don't have to teach her anything new, she already knows. πŸ‘‘


🌟 SEE ALSO 🌟

  • Catmandu::Importer
  • Catmandu::Iterable

okay that's the whole page, you're done, go import something gorgeous. πŸ’œ

this one's running on perl v5.38.2, dated 2024-08-03 β€” so like, that's the version and the date of the whole thing, and honestly? it's giving vintage but in a chic way. mwah. πŸ’‹βœ¨

πŸ“¦ where this page comes from