my $conf = {}; # configuration hashref
my $count = 0;
-my $failcount = 0;
my $start = time;
$| = 1;
for my $file (@ARGV) {
print XF "Processing $file\n";
- open my $records, '<:utf8', $file;
+ #open my $records, '<:utf8', $file; # This hack dosn't play nice with the use MARC::File::XML ( BinaryEncoding => 'utf-8' ); hack
my $batch = undef; my $record = undef;
- $batch = MARC::Batch->new('XML', $records);
+ #$batch = MARC::Batch->new('XML', $records); # The other part of the hack
+ $batch = MARC::Batch->new('XML', $file);
$batch->strict_off();
$batch->warnings_off();
- while ( eval { $record = $batch->next } ) {
- if ($@)
- { print XF "MARC::Batch error $@"; $failcount++; next }
+ while ( $record = $batch->next ) {
$count++; progress_ticker();
my $marc = undef;
unless ( defined $record )
}
}
-unless ($conf->{quiet}) {
- print "\nSuccessfully processed:\t$count\n";
- print "Failed to process:\t$failcount\n";
- print "Total: ", ($count + $failcount), "\n";
-}
-
+print "\nSuccessfully processed:\t$count\n" unless $conf->{quiet};
=head2 populate_marc