leader from WebPAC::Input::MARC is now available as rec('leader')
[webpac2] / lib / WebPAC / Input / MARC.pm
index a0ca958..da1ae31 100644 (file)
@@ -5,6 +5,7 @@ use strict;
 
 use MARC::Fast 0.03;
 use base qw/WebPAC::Common/;
+use Carp qw/confess/;
 
 =head1 NAME
 
@@ -12,11 +13,11 @@ WebPAC::Input::MARC - support for MARC database files
 
 =head1 VERSION
 
-Version 0.08
+Version 0.09
 
 =cut
 
-our $VERSION = '0.08';
+our $VERSION = '0.09';
 
 
 =head1 SYNOPSIS
@@ -82,8 +83,10 @@ sub fetch_rec {
        if ($mfn > $self->{_marc_size}) {
                $self->_get_logger()->warn("seek beyond database size $self->{_marc_size} to $mfn");
        } else {
-               my $row = $self->{_marc_db}->to_hash($mfn);
+               my $marc = $self->{_marc_db} || confess "no _marc_db?";
+               my $row = $marc->to_hash($mfn);
                push @{$row->{'000'}}, $mfn;
+               push @{$row->{'leader'}}, $marc->last_leader;
                return $row;
        }
 }