1MARC::File::MicroLIF(3)User Contributed Perl DocumentatioMnARC::File::MicroLIF(3)
2
3
4
6 MARC::File::MicroLIF - MicroLIF-specific file handling
7
9 use MARC::File::MicroLIF;
10
11 my $file = MARC::File::MicroLIF->in( $filename );
12
13 while ( my $marc = $file->next() ) {
14 # Do something
15 }
16 $file->close();
17 undef $file;
18
20 None.
21
22 The buffer must be large enough to handle any valid record because we
23 don't check for cases like a CR/LF pair or an end-of-record/CR/LF trio
24 being only partially in the buffer.
25
26 The max valid record is the max MARC record size (99999) plus one or
27 two characters per tag (CR, LF, or CR/LF). It's hard to say what the
28 max number of tags is, so here we use 6000. (6000 tags can be squeezed
29 into a MARC record only if every tag has only one subfield containing a
30 maximum of one character, or if data from multiple tags overlaps in the
31 MARC record body. We're pretty safe.)
32
34 in()
35 Opens a MicroLIF file for reading.
36
37 Gets the next chunk of data. If $want_line is true then you get the
38 next chunk ending with any combination of \r and \n of any length. If
39 it is false or not passed then you get the next chunk ending with \x60
40 followed by any combination of \r and \n of any length.
41
42 All trailing \r and \n are stripped.
43
44 header()
45 If the MicroLIF file has a file header then the header is returned. If
46 the file has no header or the file has not yet been opened then "undef"
47 is returned.
48
49 decode()
50 Decodes a MicroLIF record and returns a USMARC record.
51
52 Can be called in one of three different ways:
53
54 $object->decode( $lif )
55 MARC::File::MicroLIF->decode( $lif )
56 MARC::File::MicroLIF::decode( $lif )
57
60 MARC::File
61
63 This code may be distributed under the same terms as Perl itself.
64
65 Please note that these modules are not products of or supported by the
66 employers of the various contributors to the code.
67
69 Andy Lester, "<andy@petdance.com>"
70
71
72
73perl v5.36.0 2022-07-22 MARC::File::MicroLIF(3)