develooper Front page | perl.perl4lib | Postings from June 2006

MARC::Lint bug?

Thread Next
From:
Bryan Baldus
Date:
June 15, 2006 07:18
Subject:
MARC::Lint bug?
Message ID:
1F95E99A11EFA541B0BDE754166A8F70C7393D@qbiex.qbi.quality-books.com
I think I may have discovered a bug in the way MARC::Lint parses tag data.
In _parse_tag_rules:

    my $rules = ($self->{_rules}->{$tagno} ||= {});
    $rules->{$repeatable} = $repeatable;

then:
    for my $line ( @lines ) {
        my @keyvals = split( /\s+/, $line, 3 );
        my $key = shift @keyvals;
        my $val = shift @keyvals;
        # Do magic for indicators
        if ( $key =~ /^ind/ ) {
            $rules->{$key} = $val;
#}

I think having $rules->{$repeatable} and $rules->{$key} (where $key is the
subfield code and $repeatable is passed in from the
tagno_repeatability_description line of the tag data) is causing $repeatable
to be added as an allowable subfield code. I discovered this when wondering
why an 082 $a[B]$ROU$214 did not report an error. I plan on looking at this
tonight or this weekend. What would you suggest as the best way to resolve
this problem? My current line of thinking would have me revising
$rules->{$repeatable} to $rules->{'repeatable'}, and leaving the subfields
as $rules->{$key}. Does this sound reasonable?

Thank you for your assistance,

Bryan Baldus
bryan.baldus@quality-books.com
eijabb@cpan.org
http://home.inwave.com/eija
 

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About