MARC::Loader(3pm)
π MARC::Loader β the perl manual page, but make it cute π
okay bestie, welcome to the MARC::Loader(3pm) page, part of the User Contributed Perl Documentation situation β¨ this is the whole thing, nothing skipped, no cap. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
MARC::Loader β a Perl module for creating MARC record from a hash π
πΈ VERSION πΈ
Version 0.004001 β
π¦ SYNOPSIS π¦
like, here's the whole vibe in one go:
use MARC::Loader;
my $foo={
'ldr' => 'optionnal_leader',
'cleannsb' => 1,
'f005' => [
{
'f005_' => 'controlfield_contenta'
},
{
'f005_' => 'controlfield_contentb'
}
],
'f006_' => 'controlfield_content',
'f010d' => '45',
'f099c' => '2011-02-03',
'f099t' => 'LIVRE',
'i0991' => '3',
'i0992' => '4',
'f200a' => "\x88le \x89titre",
'001##f101a' => ['lat','fre','spa'],
'f215a' => [ 'test' ],
'f700' => [
{
'f700f' => '1900-1950',
'f700a' => 'ICHER',
'f700b' => ['jean','francis']
},
{
'f700f' => '1353? - 1435',
'f700a' => 'PAULUS',
'f700b' => 'MARIA'}
],
'f995' => [
{
'f995e' => 'S1',
'f995b' => 'MP',
'f995f' => '8002-ex'
},
{
'001##f995e' => 'S2',
'002##f995b' => 'MP',
'005##f995f' => '8001-ex'
}
]
};
my $record = MARC::Loader->new($foo);
# Here, the command "print $record->as_formatted;" will return :
# LDR optionnal_leader
# 005 controlfield_contenta
# 005 controlfield_contentb
# 006 controlfield_content
# 101 _afre
# _alat
# _aspa
# 010 _d45
# 099 34 _c2011-02-03
# _tLIVRE
# 200 _ale titre
# 215 _atest
# 700 _aICHER
# _bfrancis
# _bjean
# _f1900-1950
# 700 _aPAULUS
# _bMARIA
# _f1353? - 1435
# 995 _bMP
# _eS1
# _f8002-ex
# 995 _eS2
# _bMP
# _f8001-ex
π DESCRIPTION π
So, this is a Perl module for creating MARC records from a hash variable. And MARC::Loader use MARC::Record. that's the whole deal, iconic honestly π
π Hash keys naming convention π
ngl, the names of hash keys are very important. they have to begin with letter f followed by the 3-digit field name ( e.g. f099), followed, for the subfields, by their letter or digit ( e.g. f501b). it's giving very specific but she's worth it π
- Repeatable fields are arrays of hash ( e.g.,
'f700' => [{'f700f' => '1900','f700a' => 'ICHER'},{'f700f' => '1353','f700a' => 'PAULUS'}]). π - Repeatable subfields are arrays ( e.g.,
'f101a' => [ 'lat','fre','spa']). β¨ - Controlfields are automatically detected when the hash key begin with letter
ffollowed by 3-digit lower than10followed by underscore ( e.g.f005_). π - Indicators must begin with the letter
ifollowed by the 3-digit field name followed by the indicator's position (1or2) : e.g."i0991". β - Record's leader can be defined with the hash key
'ldr'( e.g.,'ldr' => 1). π¦
π« reorder fields and subfields π«
Fields and subfields are in lexically order. If you want reorder fields and subfields differently, you can add a reordering string (necessarily followed by ##) at the beginning of hash keys (e.g., to reorder the subfields of f995 to have $e followed by $b : 'f995' => [{'001##f995e' => 'S2','002##f995b' => 'MP')]});). If you want to reorder fields, please note that the controlfields will always be located before the other (e.g., if you define '001##f101a' => [ 'lat','fre','spa'] , the f101 will be placed after the last controlfield ). πΈ
π¨ bestie, be careful: the reorder is made lexically, not numerically :10will be placed before2, while002will be placed before010. that's just how she is, no notes π
If the script you use to build your hash requires you to precede fields AND subfields with a reordering string when you want to reorder only those sub-fields, you can force the module to reorder the fields in alphabetical order with an hash key named 'orderfields' ( e.g., 'orderfields' => 1 ). π
You can also remove non-sorting characters with an hash key named 'cleannsb' ( e.g., 'cleannsb' => 1 ). π§
π₯ METHOD π₯
π
new()
$record = MARC::Loader->new($foo);
This is the only method provided by the module. one method, one legend, main character energy periodt π
π AUTHOR π
Stephane Delaune, (delaune.stephane at gmail.com) π«Ά
π COPYRIGHT π
Copyright 2011 Stephane Delaune for Biblibre.com, all rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, free software rights π
π SEE ALSO π
MARC::Record(http://search.cpan.org/~gmcharlt/MARC-Record/lib/MARC/Record.pm) β¨MARC::Field(http://search.cpan.org/~gmcharlt/MARC-Record/lib/MARC/Field.pm) π- Library Of Congress MARC pages (
http://www.loc.gov/marc/) π- The definitive source for all things MARC. fr fr, if you need the lore, it's right there π
and that's the whole page, bestie!! π¦ this one was rendered by perl v5.36.0 on 2023-01-27, and it lives under the name MARC::Loader(3pm) β mwah, go build some records, you're gonna eat π
β¨π
π¦ where this page comes from
- debian bookworm: libmarc-loader-perl 0.004001-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmarc-loader-perl 0.004001-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmarc-loader-perl 0.004001-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmarc-loader-perl 0.004001-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmarc-loader-perl 0.004001-2 Β· 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