Catman...::MAB2(3pm)

πŸ“¦
version 0.24 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

✨ NAME ✨

Catmandu::Exporter::MAB2 β€” bestie, it's the package that exports MAB2 data. That's it, that's the whole job description πŸ’…

(oh and fun fact, this page lives in the perl section, manual name Catman...::MAB2(3pm) β€” iykyk πŸŽ€)


🌈 SYNOPSIS 🌈

okay so here's the vibe in code:

use Catmandu::Exporter::MAB2;

my $exporter = Catmandu::Exporter::MAB2->new(file => "mab2.dat", type => "RAW");
my $data = {
 record => [
    ...
    [245, '1', 'a', 'Cross-platform Perl /', 'c', 'Eric F. Johnson.'],
    ...
    ],
};

$exporter->add($data);
$exporter->commit;

literally that's the whole flow. new β†’ add β†’ commit. slay ✨


πŸ¦‹ Arguments πŸ¦‹

these are the little guys you can pass in:

  • file β€” the path to the file with your MAB2 records. πŸ“
  • fh β€” an already-open filehandle for the file with MAB2 records. 🫢
  • type β€” tells it what flavor of MAB2 records you're dealing with: Disk (Diskette), RAW (Band), or XML. Default: 001. Optional. 🌸
  • xml_declaration β€” writes the XML declaration. Set it to 0 or 1. Default: 0. Optional. ✨
  • collection β€” wraps your records in a collection element (<datei>). Set it to 0 or 1. Default: 0. Optional. πŸŽ€

πŸ‘‘ METHODS πŸ‘‘

πŸ’œ new(file => $file | fh => $filehandle [, type => XML, xml-declaration => 1, collection => 1])

Creates a brand new Catmandu MAB2 export that serializes into a $file. main character energy fr fr 🌟

πŸ’œ add($data)

Drops a record into the exporter. one at a time, no rush bestie πŸ’–

πŸ’œ commit()

Closes the collection (if you even have one, it's optional) and the filehandle. this is your goodbye kiss 😭


🧚 CONFIGURATION 🧚

on top of all the config that Catmandu::Exporter already gives you (file, fh, etc. β€” the classics), the importer can also be configured with these parameters:

  • type β€” the MAB2 syntax variant. go peek at Catmandu::Importer::MAB2 for the deets. πŸ”
  • xml_declaration β€” writes the XML declaration. Set to 0 or 1. Default: 0. Optional. ✨
  • collection β€” wraps records in the collection element (<datei>). Set to 0 or 1. Default: 0. Optional. πŸŽ€

🌸 AUTHOR 🌸

Johann Rolschewski <jorol@cpan.org> β€” the icon, the legend, the moment πŸ‘‘


This software is copyright (c) 2013 by Johann Rolschewski.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. free as in freedom, bestie πŸ•ŠοΈ


and that's a wrap!! this page is from perl v5.36.0, dated 2022-12-04, filed under Catman...::MAB2(3pm) β€” go forth and export ur MAB2 records, periodt πŸ’…πŸ’–βœ¨
πŸ“¦ where this page comes from