Catman...::Lint(3pm)
β¨ NAME β¨
okay so bestie, welcome to Catman...::Lint (it lives in the User Contributed Perl Documentation section, 3pm, iykyk) π
Catmandu::Importer::MARC::Lint β a package that imports USMARC records, except it runs them through MARC::Lint first so you get that validation tea ββ¨
πΈ SYNOPSIS πΈ
# From the command line
$ catmandu convert MARC --type Lint --fix "marc_map('245a','title')" < /foo/data.mrc
# From perl
use Catmandu;
# import records from file
my $importer = Catmandu->importer('MARC',file => '/foo/data.mrc', type => 'Lint');
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};
});
π¦ DESCRIPTION π¦
so every single item that the Catmandu::Importer::MARC::Lint importer hands you comes with three keys, no more no less, periodt π
'_id' : the system identifier of the record (usually the 001 field)
'record' : an ARRAY of ARRAYs containing the record data
'lint' : the output of MARC::Lint's check_record on the MARC record
'_id'β the system identifier of the record, which is usually the001field π'record'β anARRAYofARRAYs holding the record data, it's giving nested, it's giving structure π§'lint'β literally the output ofMARC::Lint'scheck_recordrun on the MARC record π₯
π CONFIGURATION π
idβ the MARC field that holds the system id (default:001) π«Άfileβ read input from a local file by passing its path. alternatively you can pass a scalar reference and it'll read from a string, flexible much? πfhβ read input from anIO::Handle. if you don't specify one,Catmandu::Util::iogets used to create the input stream from the"file"argument, or fromSTDINπencodingβ binmode of the input stream"fh". it's set to":utf8"by default, iconic πfixβ anARRAYof one or more fixes or file scripts that get applied to the imported items β¨
π METHODS π
every Catmandu::Importer is a Catmandu::Iterable, so all its methods are inherited β you get the whole inheritance situation for free, slay π
π SEE ALSO π
Catmandu::ImporterCatmandu::Iterable
okay that's the whole page bestie, go forth and lint those MARC records π this was perl v5.38.2, dated 2024-08-03, and yes it's still filed under Catman...::Lint(3pm) because the vibes are eternal πβ¨π¦
π¦ 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