| Lines 31-36
          use Getopt::Long;
      
      
        Link Here | 
        
          | 31 | use IO::File; | 31 | use IO::File; | 
        
          | 32 | use Pod::Usage; | 32 | use Pod::Usage; | 
        
          | 33 |  | 33 |  | 
            
              |  |  | 34 | my $localcust= $FindBin::Bin.'/LocalChanges.pm'; | 
            
              | 35 | $localcust= -e $localcust? $localcust: undef; | 
            
              | 36 | require $localcust if $localcust; | 
            
              | 37 | $localcust=\&customize if $localcust; | 
            
              | 38 |  | 
        
          | 34 | use open qw( :std :encoding(UTF-8) ); | 39 | use open qw( :std :encoding(UTF-8) ); | 
        
          | 35 | binmode( STDOUT, ":encoding(UTF-8)" ); | 40 | binmode( STDOUT, ":encoding(UTF-8)" ); | 
        
          | 36 | my ( $input_marc_file, $number, $offset) = ('',0,0); | 41 | my ( $input_marc_file, $number, $offset) = ('',0,0); | 
  
    | Lines 52-58
          GetOptions(
      
      
        Link Here | 
        
          | 52 |     't|test' => \$test_parameter, | 57 |     't|test' => \$test_parameter, | 
        
          | 53 |     's' => \$skip_marc8_conversion, | 58 |     's' => \$skip_marc8_conversion, | 
        
          | 54 |     'c:s' => \$char_encoding, | 59 |     'c:s' => \$char_encoding, | 
          
            
              | 55 |     'v:s' => \$verbose, | 60 |     'v:i' => \$verbose, | 
        
          | 56 |     'fk' => \$fk_off, | 61 |     'fk' => \$fk_off, | 
        
          | 57 |     'm:s' => \$format, | 62 |     'm:s' => \$format, | 
        
          | 58 |     'l:s' => \$logfile, | 63 |     'l:s' => \$logfile, | 
  
    | Lines 202-210
          RECORD: while (  ) {
      
      
        Link Here | 
        
          | 202 |     # skip if we get an empty record (that is MARC valid, but will result in AddBiblio failure | 207 |     # skip if we get an empty record (that is MARC valid, but will result in AddBiblio failure | 
        
          | 203 |     last unless ( $record ); | 208 |     last unless ( $record ); | 
        
          | 204 |     $i++; | 209 |     $i++; | 
          
            
              | 205 |     print "."; | 210 |     if( ($verbose//1)==1 ) { #no dot for verbose==2 | 
            
              | 206 |     print "\n$i" unless $i % 100; | 211 |         print "." . ( $i % 100==0 ? "\n$i" : '' ); | 
            
              | 207 |      | 212 |     } | 
            
              |  |  | 213 |  | 
        
          | 208 |     # transcode the record to UTF8 if needed & applicable. | 214 |     # transcode the record to UTF8 if needed & applicable. | 
        
          | 209 |     if ($record->encoding() eq 'MARC-8' and not $skip_marc8_conversion) { | 215 |     if ($record->encoding() eq 'MARC-8' and not $skip_marc8_conversion) { | 
        
          | 210 |         # FIXME update condition | 216 |         # FIXME update condition | 
  
    | Lines 216-221
          RECORD: while (  ) {
      
      
        Link Here | 
        
          | 216 |         } | 222 |         } | 
        
          | 217 |     } | 223 |     } | 
        
          | 218 |     SetUTF8Flag($record); | 224 |     SetUTF8Flag($record); | 
            
              |  |  | 225 |     &$localcust($record) if $localcust; | 
        
          | 219 |     my $isbn; | 226 |     my $isbn; | 
        
          | 220 |     # remove trailing - in isbn (only for biblios, of course) | 227 |     # remove trailing - in isbn (only for biblios, of course) | 
        
          | 221 |     if ($biblios && $cleanisbn) { | 228 |     if ($biblios && $cleanisbn) { | 
  
    | Lines 459-464
          RECORD: while (  ) {
      
      
        Link Here | 
        
          | 459 |         } | 466 |         } | 
        
          | 460 |         $dbh->commit() if (0 == $i % $commitnum); | 467 |         $dbh->commit() if (0 == $i % $commitnum); | 
        
          | 461 |     } | 468 |     } | 
            
              |  |  | 469 |     print $record->as_formatted()."\n" if ($verbose//0)==2; | 
        
          | 462 |     last if $i == $number; | 470 |     last if $i == $number; | 
        
          | 463 | } | 471 | } | 
        
          | 464 | $dbh->commit(); | 472 | $dbh->commit(); | 
            
              | 465 | -  |  |  |