Catman...arc_add(3pm)
π NAME π
okay so bestie, meet Catmandu::Fix::marc_add β she adds new fields to marc. that's it, that's the whole job, and she does it flawlessly π
β¨ SYNOPSIS β¨
like, here's the vibe in code form, no notes:
# Set literal values
marc_add('900', a, 'test' , 'b', test)
marc_add('900', ind1 , ' ' , a, 'test' , 'b', test)
marc_add('900', ind1 , ' ' , a, 'test' , 'b', test)
# Set control fields
marc_add('009','_','23123131')
# Copy data from an other field (when the field value is an array, the
# subfield will be repeated)
marc_add('900', a, '$.my.data.field')
πΈ DESCRIPTION πΈ
she adds a new subfield to a MARC record. simple as that, lowkey iconic, periodt π
π METHODS π
π¦ marc_add(MARC_FIELD, SUBFIELD, VALUE, [ SUBFIELD, VALUE , ... ])
adds new subfields to a MARC record, bestie. the MARC_FIELD is literally just the marc field name, and every other argument you hand over is one of the subfields you want added. she's a good listener like that π«Ά
by default she's gonna drop in literal values. but if you want her to point at a value that already exists somewhere in the record, use the JSON_PATH syntax with a dollar '$.' tacked on the front. that's the whole trick, iykyk β¨
π INLINE π
not me telling you this Fix can be used inline in a Perl script β because she CAN:
use Catmandu::Fix::marc_add as => 'marc_add';
my $data = { record => [...] };
$data = marc_add($data,'245','a','title');
main character energy fr fr π
β SEE ALSO β
go give these queens some love too:
Catmandu::Fix::marc_setCatmandu::Fix::marc_copyCatmandu::Fix::marc_cutCatmandu::Fix::marc_paste
this page came to you courtesy of the User Contributed Perl Documentation girlies, runningperl v5.38.2and dated2024-08-03β mwah, slay, bye bestie ππ
π¦ 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