Thanks to Christoffer and Ashley there is a new MARC::Record available 
on CPAN [1] which will create leader defaults for positions 10-11 and 20-23.
This should make MARC::Record interoperate with Zebra better. I hadn't heard
of Zebra before, although I've used YAZ. It looks very interesting, and 
am building it right now in fact :) 

In addition the MARC::Batch::next() method in v1.31 has been adjusted to allow 
you to pass in a 'filter function' as MARC::File::next() already does. 

This feature speeds up MARC::Record performance when you are only
interested in extracting particular fields from the record, by avoiding 
the needless creation of MARC::Field objects in the MARC::Record. Andy 
tells me there are huge performance gains made, so if you are extracting 
data out of large batches you might be interested in using a filter. Here's
an example:

    use MARC::Batch;

    ## create batch file
    my $batch = MARC::Batch->new( 'USMARC', 'bigfile.dat' );

    ## go through each record using a filter function wanted()
    while ( my $r = $batch->next( \&wanted ) ) {
        print $r->field( '245' )->as_string(), "\n";
    }

    ## filter function which accepts only 245 fields
    sub wanted {
        my ( $tag, $data ) = @_;
        return( 1 ) if ( $tag eq '245' );
        return( 0 );
    }

Kind of a nice trick to have up your sleeve if you need it.

//Ed

[1] http://search.cpan.org/perldoc?MARC::Record

Reply via email to