use IO::File;
use Pod::Usage;
-my $localcust= $FindBin::Bin.'/LocalChanges.pm';
-$localcust= -e $localcust? $localcust: undef;
-require $localcust if $localcust;
-$localcust=\&customize if $localcust;
-
use open qw( :std :encoding(UTF-8) );
binmode( STDOUT, ":encoding(UTF-8)" );
my ( $input_marc_file, $number, $offset) = ('',0,0);
my $cleanisbn = 1;
my ($sourcetag,$sourcesubfield,$idmapfl, $dedup_barcode);
my $framework = '';
+my $localcust;
$|=1;
'yaml:s' => \$yamlfile,
'dedupbarcode' => \$dedup_barcode,
'framework=s' => \$framework,
+ 'custom:s' => \$localcust,
);
$biblios ||= !$authorities;
$insert ||= !$update;
exit;
}
+if(defined $localcust) { #local customize module
+ if(!-e $localcust) {
+ $localcust= $localcust||'LocalChanges'; #default name
+ $localcust=~ s/^.*\/([^\/]+)$/$1/; #extract file name only
+ $localcust=~ s/\.pm$//; #remove extension
+ my $fqcust= $FindBin::Bin."/$localcust.pm"; #try migration_tools dir
+ if(-e $fqcust) {
+ $localcust= $fqcust;
+ }
+ else {
+ print "WARNING: customize module $localcust.pm not found!\n";
+ exit;
+ }
+ }
+ require $localcust if $localcust;
+ $localcust=\&customize if $localcust;
+}
+
my $dbh = C4::Context->dbh;
my $heading_fields=get_heading_fields();
to them when they are created. If not specified, then the default framework
will be used.
+=item B<-custom>=I<MODULE>
+
+This parameter allows you to use a local module with a customize subroutine
+that is called for each MARC record.
+If no filename is passed, LocalChanges.pm is assumed to be in the
+migration_tools subdirectory. You may pass an absolute file name or a file name
+from the migration_tools directory.
+
=back
=cut