MAB2::...::Disk(3pm)

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

🌸 NAME 🌸

MAB2::Writer::Disk β€” it's the MAB2 Diskette format serializer, bestie. That's the whole vibe. It takes your MAB2 records and writes them out in Diskette format, no cap. πŸ’–

(Also, hi, this page lives in the User Contributed Perl Documentation corner of the manual-verse, and its manual name is MAB2::...::Disk(3pm). Now you know. πŸŽ€)


✨ SYNOPSIS ✨

Okay so MAB2::Writer::Disk is a MAB2 Diskette serializer. That's it, that's the girl. πŸ’…

use MAB2::Writer::Disk;

my @mab_records = (

    [
      ['001', ' ', '_', '2415107-5'],
      ['331', ' ', '_', 'Code4Lib journal'],
      ['655', 'e', 'u', 'http://journal.code4lib.org/', 'z', 'kostenfrei'],
      ...
    ],
    {
      record => [
          ['001', ' ', '_', '2415107-5'],
          ['331', ' ', '_', 'Code4Lib journal'],
          ['655', 'e', 'u', 'http://journal.code4lib.org/', 'z', 'kostenfrei'],
          ...
      ]
    }
);

$writer = MAB2::Writer::Disk->new( fh => $fh );

foreach my $record (@mab_records) {
    $writer->write($record);
}

Like… look at her go. πŸ¦‹ You make the writer, you loop your records, you write them. Iconic behaviour, honestly.


🌷 Arguments 🌷

  • subfield_indicator β€” this one sets the subfield separator for you. If you don't pass anything, the default is INFORMATION SEPARATOR ONE. It's optional, so no pressure, you do you. πŸ’œ
Also peep MAB2::Writer::Handle for more, iykyk. πŸ‘‘

🧚 METHODS 🧚

Here's the lineup, periodt:

new(file => $file | fh => $fh [, encoding => 'UTF-8', subfield_separator => '$'])

The constructor, the main character moment. You give her a file or an fh, and optionally an encoding (like 'UTF-8') and a subfield_separator (like '$'). Slay. ✨

_write_record($record)

The little internal worker bee that actually writes out a record. πŸ“


🌈 SEEALSO 🌈

Go look at these too, bestie:

  • MAB2::Writer::Handle
  • Catmandu::Exporter

πŸ‘‘ AUTHOR πŸ‘‘

Johann Rolschewski <jorol@cpan.org> β€” the legend who made this. 🫢


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. So like, go forth and remix, respectfully. πŸ’…


Mwah, that's the whole page! This absolute bop was brought to you by perl v5.36.0 and dated 2022-12-04, from the MAB2::...::Disk(3pm) manual. Byeee, go serialize something cute! πŸ’œπŸ¦‹

πŸ“¦ where this page comes from