Skip Menu |

This queue is for tickets about the MARC-Record CPAN distribution.

Report information
The Basics
Id: 1576
Status: resolved
Priority: 0/
Queue: MARC-Record

People
Owner: Nobody in particular
Requestors: andy [...] petdance.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Allow MARC::File::next to filter fields for us
Consider this canonical metaphor: while ( my $marc = $file->next() ) { for my $field ( $marc->field("6XX") ) { # Do something with the 6XX tags } } This is inefficient in two ways: 1) We're getting back records that might not have 6XX tags, and 2) We're getting back fields in the records that we know we don't care about Record and field creation in MARC::Record is fairly expensive, especially if we want to ignore 90% of them. Let's allow MARC::File::next to act as a filter when reading, as in: while ( my $marc = $file->next( '6XX' ) { for my $field ( $marc->fields() ) { # Do something with the 6XX } }