From: Shawn Boyette Date: Tue, 11 Nov 2008 16:46:16 +0000 (+0000) Subject: edit now sets $ptr to zero on exit, forcing checks of all manual edits X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=cef2eef04fa67f9ef12e54dd6fcdfd499ceb693f edit now sets $ptr to zero on exit, forcing checks of all manual edits --- diff --git a/marc-cleanup b/marc-cleanup index 96f3250..834331e 100755 --- a/marc-cleanup +++ b/marc-cleanup @@ -70,7 +70,6 @@ while ( buildrecord() ) { my $match = $1; if ($match =~ /\D/) { edit("Non-numerics in tag"); - $ptr = 0; next; } } @@ -80,7 +79,6 @@ while ( buildrecord() ) { my $match = $1; if ($match =~ /\P{IsAlnum}/ or $match eq '') { edit("Junk in subfield code/Null subfield code"); - $ptr = 0; next; } } @@ -208,6 +206,7 @@ sub edit { print_linecontext(); } } + $ptr = 0; } =head2 buildrecord @@ -292,7 +291,7 @@ sub print_linecontext { my $low = ($ptr - 3 < 0) ? 0 : $ptr - 3; print $OUT ' |', $record[$_] for ($low .. $ptr - 1); print $OUT '==> |', $record[$ptr]; - print $OUT ' |', $record[$ptr + 1], "\n"; + print $OUT ' |', $record[$ptr + 1], "\n" unless ($ptr == $#record); return 0; }