Koha::Util::MARC - utility class with routines for working with MARC records
Create a hash to use when merging MARC records
Create a random value to set it into the input name
Retrieve the authorized heading from a MARC authority record
set_marc_field($record, $marcField, $value);
Set the value of $marcField to $value in $record. If the field exists, it will be updated. If not, it will be created.
$record
MARC::Record object
$marcField
the MARC field to modify, a string in the form of 'XXX$y'
$value
the value
my $first = find_marc_info({ record => $marc, field => $field, subfield => $subfield, match => qr/regex/ }); my @found = find_marc_info({ record => $marc, field => $field, subfield => $subfield, match => qr/regex/ }); Returns first or all occurrences of field/subfield in record where regex matches. Subfield is not used for control fields. Match is optional.
my $id = strip_orgcode( '(code) 123' ); # returns '123' Strips from starting left paren to first right paren and trailing whitespace.
my $id = oclc_number( $record ); Based on applying strip_orgcode on first occurrence of find_marc_info with orgcode matching regex in 035$a.