MARC::...croLIF(3pm)

πŸ“¦
version 2.0.7 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

MARC::File::MicroLIF β€” the MicroLIF-flavored file handling girlie ✨ like, this is the module that knows how to read MicroLIF files specifically, bestie πŸŽ€


🌸 SYNOPSIS 🌸

Okay so here's the whole vibe in code:

use MARC::File::MicroLIF;

my $file = MARC::File::MicroLIF->in( $filename );

while ( my $marc = $file->next() ) {
    # Do something
}
$file->close();
undef $file;

That's it, that's the whole flow πŸ’…


πŸ¦‹ EXPORT πŸ¦‹

None. Nada. Nothing gets exported, no cap πŸ™ˆ

The buffer must be large enough to handle any valid record β€” because we do not check for cases like a CR/LF pair, or an end-of-record/CR/LF trio, being only partially in the buffer. So like, be generous with the buffer, okay? It's giving "trust me bro" energy but for real fr fr.

The max valid record is the max MARC record size (99999) plus one or two characters per tag (CR, LF, or CR/LF). It's genuinely hard to say what the max number of tags is, so here we use 6000. And like β€” 6000 tags can only get squeezed into a MARC record if every single tag has just one subfield containing a maximum of one character, or if data from multiple tags overlaps in the MARC record body. So basically we're pretty safe πŸ’œ


⭐ METHODS ⭐

πŸŽ€ in()

Opens a MicroLIF file for reading.

It gets the next chunk of data. If $want_line is true then you get the next chunk ending with any combination of \r and \n of any length. If it's false or not passed at all, then you get the next chunk ending with \x60 followed by any combination of \r and \n of any length.

All trailing \r and \n get stripped 🧚

If the MicroLIF file has a file header, then the header is returned πŸ’– If the file has no header β€” or the file hasn't been opened yet β€” then undef is returned. So like, undef is the "no thoughts, head empty" response here 😭

πŸ‘‘ decode()

Decodes a MicroLIF record and returns a USMARC record. Main character behavior, honestly 🌈

Can be called in one of three different ways:

$object->decode( $lif )
MARC::File::MicroLIF->decode( $lif )
MARC::File::MicroLIF::decode( $lif )

Pick your fighter, they all eat πŸ”₯


πŸ’€ TODO πŸ’€

(crickets) β€” nothing listed here, bestie 🫢


  • MARC::File

πŸ’… LICENSE πŸ’…

This code may be distributed under the same terms as Perl itself.

Please note that these modules are not products of or supported by the employers of the various contributors to the code. So like, your boss is not your tech support for this one πŸ™ˆ


✨ AUTHOR ✨

Andy Lester, "<andy@petdance.com>" β€” iconic, we stan πŸ‘‘


This was MARC::...croLIF(3pm) from the User Contributed Perl Documentation, and the page was generated with perl v5.36.0 on 2022-10-13 πŸŽ€ thanks for reading bestie, go read some records πŸ’–βœ¨
πŸ“¦ where this page comes from