while (my $record = $marc_batch->next()) {
+ modify_auth_005($record);
+
my @matches = find_matching_auths($record);
push(@matches, find_replaced_auths($record));
}
}
+# Update the 005 field to the current date
+sub modify_auth_005 {
+ my $record = shift;
+ my $field_005 = $record->field('005');
+
+ # MARC 005-formatted date value
+ my $now_date = DateTime->now(
+ time_zone => 'local')->strftime('%Y%m%d%H%M%S.0');
+
+ if ($field_005) {
+ $field_005->update($now_date);
+
+ } else {
+ $field_005 = MARC::Field->new('005', $now_date);
+ $record->insert_fields_ordered($field_005);
+ }
+}
+
sub update_auth {
my $marcxml = shift;