#!/usr/bin/perl
+
+# Copyright 2009-2012, Equinox Software, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
require 5.10.0;
use strict;
sub stow_record_data {
# get tag data if we're looking at it
my $tag = 0;
- if ($record[$ptr] =~ m/<(control|data)field tag="(?<TAG>.{3})"/) {
- $recmeta{tag} = $+{TAG};
+ if ($record[$ptr] =~ m/<(?:control|data)field tag="(.{3})"/) {
+ $recmeta{tag} = $1;
$tag = $recmeta{tag};
- $record[$ptr] =~ m/ind1="(?<IND1>.)"/;
- $recmeta{ind1} = $+{IND1} || '';
- $record[$ptr] =~ m/ind2="(?<IND2>.)"/;
- $recmeta{ind2} = $+{IND2} || '';
+ $record[$ptr] =~ m/ind1="(.)"/;
+ $recmeta{ind1} = $1 || '';
+ $record[$ptr] =~ m/ind2="(.)"/;
+ $recmeta{ind2} = $1 || '';
unless ($tag) {
message("Autokill record: no detectable tag");
show_trashhelp() if ($c->{trashhelp});
# defaults
- my $pfx = $c->{prefix} // "bibs";
+ my $pfx = defined($c->{prefix}) ? $c->{prefix} : "bibs";
$c->{ricount} = 0;
$c->{rocount} = 0;
$c->{'renumber-tag'} = 903 unless defined $c->{'renumber-tag'};
--output -o Cleaned MARCXML output filename
--exception -x Exception (dumped records) MARCXML filename
or
- --prefix=<PREFIX>> -p Shared prefix for output/exception files. Will produce
+ --prefix=<PREFIX> -p Shared prefix for output/exception files. Will produce
PREFIX.clean.marc.xml and PREFIX.exception.marc.xml
--marcfile -m Input filename. Defaults to PREFIX.marc.xml