removing eval trap altogether
[migration-tools.git] / fingerprinter
index 424db25..ecc14aa 100755 (executable)
@@ -6,6 +6,7 @@ use open ':utf8';
 use Getopt::Long;
 use MARC::Batch;
 use Unicode::Normalize;
+use MARC::File::XML ( BinaryEncoding => 'utf-8' );
 
 my $conf  = {}; # configuration hashref
 my $count = 0;
@@ -28,9 +29,9 @@ for my $file (@ARGV) {
     $batch->strict_off();
     $batch->warnings_off();
 
-    while ( eval { $record = $batch->next } ) {
-        my $marc = undef;
+    while ( $record = $batch->next ) {
         $count++; progress_ticker();
+        my $marc = undef;
         unless ( defined $record )
           { dump_exception($marc); next; }
 
@@ -48,9 +49,8 @@ for my $file (@ARGV) {
         dump_fingerprints($marc);
     }
 }
-print "\nProcessed $count records\n" unless $conf->{quiet};
-
 
+print "\nSuccessfully processed:\t$count\n" unless $conf->{quiet};
 
 =head2 populate_marc