--- trunk/run.pl 2006/07/02 10:27:06 558 +++ trunk/run.pl 2006/07/02 12:42:02 559 @@ -77,6 +77,10 @@ By default turned on if C<--marc-normalize> is used. You can disable lint messages with C<--no-marc-lint>. +=item --marc-dump + +Force dump or input and marc record for debugging. + =back =cut @@ -92,6 +96,7 @@ my $validate_path; my ($marc_normalize, $marc_output); my $marc_lint = 1; +my $marc_dump = 0; GetOptions( "limit=i" => \$limit, @@ -106,6 +111,7 @@ "marc-normalize=s" => \$marc_normalize, "marc-output=s" => \$marc_output, "marc-lint!" => \$marc_lint, + "marc-dump!" => \$marc_dump, ); $config = LoadFile($config); @@ -322,6 +328,7 @@ $log->warn("MARC record $mfn is empty, skipping"); } else { $marc->add_fields( @marc_fields ); + if ($marc_lint) { $lint->check_record( $marc ); my $err = join( "\n", $lint->warnings ); @@ -331,6 +338,14 @@ "MARC lint warnings: ",$err,"\n" ) if ($err); } + + if ($marc_dump) { + $log->info("MARC record on MFN $mfn\n", + "Original imput row: ",dump($row), "\n", + "Normalized MARC row: ",dump(@marc_fields), "\n", + ); + } + print $marc_fh $marc->as_usmarc; } }