4 |
use strict; |
use strict; |
5 |
|
|
6 |
use MARC::Fast 0.03; |
use MARC::Fast 0.03; |
7 |
|
use base qw/WebPAC::Common/; |
8 |
|
|
9 |
=head1 NAME |
=head1 NAME |
10 |
|
|
12 |
|
|
13 |
=head1 VERSION |
=head1 VERSION |
14 |
|
|
15 |
Version 0.05 |
Version 0.06 |
16 |
|
|
17 |
=cut |
=cut |
18 |
|
|
19 |
our $VERSION = '0.05'; |
our $VERSION = '0.06'; |
20 |
|
|
21 |
|
|
22 |
=head1 SYNOPSIS |
=head1 SYNOPSIS |
24 |
Open USMARC, Unimarc or any other file format that has same internal |
Open USMARC, Unimarc or any other file format that has same internal |
25 |
structure using C<MARC::Fast>. |
structure using C<MARC::Fast>. |
26 |
|
|
27 |
my $marc = new WebPAC::Input::MARC(); |
my $marc = new WebPAC::Input::MARC( |
28 |
$marc->open( path => '/path/to/marc.iso' ); |
path => '/path/to/marc.iso' |
29 |
|
); |
30 |
|
|
31 |
=head1 FUNCTIONS |
=head1 FUNCTIONS |
32 |
|
|
33 |
=head2 open_db |
=head2 new |
34 |
|
|
35 |
Returns handle to database and size in records |
Returns new low-level input API object |
36 |
|
|
37 |
my ($db,$size) = $open_db( |
my $marc = new WebPAC::Input::MARC( |
38 |
path => '/path/to/marc.iso', |
path => '/path/to/marc.iso', |
39 |
filter => \&code_ref, |
filter => \&code_ref, |
40 |
} |
} |
41 |
|
|
42 |
=cut |
=cut |
43 |
|
|
44 |
sub open_db { |
sub new { |
45 |
my $self = shift; |
my $class = shift; |
46 |
|
my $self = {@_}; |
47 |
|
bless($self, $class); |
48 |
|
|
49 |
my $arg = {@_}; |
my $arg = {@_}; |
50 |
|
|
61 |
$self->{_marc_size} = $db_size; |
$self->{_marc_size} = $db_size; |
62 |
$self->{_marc_db} = $db; |
$self->{_marc_db} = $db; |
63 |
|
|
64 |
return ($db, $db_size); |
$self ? return $self : return undef; |
65 |
} |
} |
66 |
|
|
67 |
=head2 fetch_rec |
=head2 fetch_rec |
88 |
} |
} |
89 |
} |
} |
90 |
|
|
91 |
=head1 PROPERTIES |
=head2 size |
92 |
|
|
93 |
=head2 _marc_size |
Return number of records in database |
94 |
|
|
95 |
Store size of MARC database |
my $size = $isis->size; |
96 |
|
|
97 |
print $self->{_marc_size}; |
=cut |
98 |
|
|
99 |
|
sub size { |
100 |
|
my $self = shift; |
101 |
|
return $self->{_marc_size}; |
102 |
|
} |
103 |
|
|
104 |
|
|
105 |
=head1 AUTHOR |
=head1 AUTHOR |