Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#4 MARC::Lint docs wrong

None
closed-fixed
nobody
None
5
2013-02-09
2003-04-16
Adam Di Carlo
No

The example listed on the top of the POD documentation for
MARC::Lint is wrong. Here's my better and *working*
rewrite of a script that takes USMARC data and lints it.

use MARC::File::USMARC;
use MARC::Lint;

my $linter = new MARC::Lint;
my $filename = shift;

my $in = MARC::File::USMARC->in($filename)
or die "Couldn't open $filename: $!\n";

while ( my $marc = $in->next() ) {
die $MARC::Record::ERROR unless $marc;
$linter->check_record($marc);

if ( $linter->warnings ) {
# Print the title tag
print $marc->subfield(245,"a"), "\n";

# Print the errors that were found
print join( "\n", $linter->warnings ) . "\n";
}
} # while

close IN or die "Error closing $filename: $!\n";

Discussion

  • Galen Charlton
    Galen Charlton
    2013-02-09

    • status: open --> closed-fixed
    • milestone: -->
     
  • Galen Charlton
    Galen Charlton
    2013-02-09

    Cleaning up old bugs; looks like your suggestion was incorporated back in 2004.