3 |
use warnings; |
use warnings; |
4 |
use strict; |
use strict; |
5 |
|
|
6 |
use MARC::Fast 0.03; |
use MARC::Fast; |
7 |
use base qw/WebPAC::Common/; |
use base qw/WebPAC::Common/; |
8 |
|
use Carp qw/confess/; |
9 |
|
|
10 |
=head1 NAME |
=head1 NAME |
11 |
|
|
13 |
|
|
14 |
=head1 VERSION |
=head1 VERSION |
15 |
|
|
16 |
Version 0.08 |
Version 0.09 |
17 |
|
|
18 |
=cut |
=cut |
19 |
|
|
20 |
our $VERSION = '0.08'; |
our $VERSION = '0.09'; |
21 |
|
|
22 |
|
|
23 |
=head1 SYNOPSIS |
=head1 SYNOPSIS |
71 |
|
|
72 |
my $rec = $self->fetch_rec( $mfn ); |
my $rec = $self->fetch_rec( $mfn ); |
73 |
|
|
|
} |
|
|
|
|
74 |
=cut |
=cut |
75 |
|
|
76 |
sub fetch_rec { |
sub fetch_rec { |
81 |
if ($mfn > $self->{_marc_size}) { |
if ($mfn > $self->{_marc_size}) { |
82 |
$self->_get_logger()->warn("seek beyond database size $self->{_marc_size} to $mfn"); |
$self->_get_logger()->warn("seek beyond database size $self->{_marc_size} to $mfn"); |
83 |
} else { |
} else { |
84 |
my $row = $self->{_marc_db}->to_hash($mfn); |
my $marc = $self->{_marc_db} || confess "no _marc_db?"; |
85 |
|
my $row = $marc->to_hash($mfn, include_subfields => 1); |
86 |
push @{$row->{'000'}}, $mfn; |
push @{$row->{'000'}}, $mfn; |
87 |
|
push @{$row->{'leader'}}, $marc->last_leader; |
88 |
return $row; |
return $row; |
89 |
} |
} |
90 |
} |
} |
95 |
|
|
96 |
print $self->dump_ascii( $mfn ); |
print $self->dump_ascii( $mfn ); |
97 |
|
|
|
} |
|
|
|
|
98 |
=cut |
=cut |
99 |
|
|
100 |
sub dump_ascii { |
sub dump_ascii { |