Catman...croLIF(3pm)
π 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 is001. 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 anIO::Handle. if you don't specify one,Catmandu::Util::iogets used to build the input stream from thefileargument, or by using STDIN. π«Άencodingβ the binmode of the input streamfh. it's set to:utf8by default. we stay encoded, we stay iconic. πfixβ anARRAYof 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::ImporterCatmandu::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
- 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