Catman...arc_set(3pm)

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

πŸ’– Catmandu::Fix::marc_set πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation, section 3pm β€” it's all about Catmandu::Fix::marc_set, and she's here to set a MARC value on one little (sub)field to a brand new value. no cap. πŸŽ€


✨ NAME ✨

Catmandu::Fix::marc_set β€” set a marc value of one (sub)field to a new value πŸ¦‹


🌸 SYNOPSIS 🌸

# Set a field in the leader
if marc_match('LDR/6','c')
    marc_set('LDR/6','p')
end

# Set a control field
marc_set('001',1234)

# Set all the 650-p fields to 'test'
marc_set('650p','test')

# Set the 100-a subfield where indicator-1 is 3
marc_set('100[3]a','Farquhar family.')

# Copy data from another field in a subfield
marc_set('100a','$.my.deep.field')

πŸ’… DESCRIPTION πŸ’…

Set the value of a MARC subfield to a new value. that's it, that's the vibe. iconic behavior honestly πŸ‘‘


🫢 METHODS 🫢

πŸ’œ marc_set(MARC_PATH , VALUE)

Set a MARC subfield to a particular new value. This value can be a literal or it can reference an existing field in the record using the dollar JSON_PATH syntax. lowkey the flexibility is the whole point fr fr ✨


🌈 INLINE 🌈

This Fix can be used inline in a Perl script, which is giving main character energy:

use Catmandu::Fix::marc_set as => 'marc_set';

my $data = { record => [...] };

$data = marc_set($data, '245a', 'test');

πŸ”₯ SEE ALSO πŸ”₯

  • Catmandu::Fix::marc_add
  • Catmandu::Fix::marc_copy
  • Catmandu::Fix::marc_cut
  • Catmandu::Fix::marc_paste

go read those too, they're the rest of the friend group 🫢


and that's a wrap, bestie πŸ’– this was written for perl v5.38.2 and stamped 2024-08-03 β€” go slay some MARC records, periodt 🌟
πŸ“¦ where this page comes from