MAB2::...er::XML(3pm)

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

✨ MAB2::Parser::XML β€” the manual page, but make it cute ✨

okay bestie, so this is the docs for MAB2::Parser::XML (that's the 3pm section of the Perl manual, iykyk β€” the header up top truncates it to MAB2::...er::XML(3pm) which is honestly giving ✨mystery✨ but it's literally just the same module). It's a MAB2 XML parser. That's the whole vibe. πŸ’…


🌸 NAME 🌸

MAB2::Parser::XML β€” a MAB2 XML parser. no cap, that's it, that's the name. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

MAB2::Parser::XML is a parser for MAB2 XML records. she parses. that's her job. πŸ’–

use MAB2::Parser::XML;

my $parser = MAB2::Parser::XML->new( $filename );

while ( my $record_hash = $parser->next() ) {
    # do something
}

look at her go πŸ₯Ή the while loop just keeps calling next() until there's nothing left. main character energy fr fr.


🌈 Arguments 🌈

  • file β€” path to the file with the MAB2 XML records. give her a path, she'll find it. πŸ—ΊοΈ
  • fh β€” an open filehandle for the file with MAB2 XML records. already opened, bestie, don't make her do it. πŸ™ˆ
  • string β€” an XML string with MAB2 XML records. just raw string energy. ✨

πŸ’œ METHODS πŸ’œ

⭐ new($filename | $filehandle | $string)

the constructor, the moment of creation, the birth of your parser πŸ‘‘ you can hand her a $filename, a $filehandle, or a $string β€” pick your fighter. any of the three works, she's flexible like that.

πŸ“ next()

Reads the next record from the MAB2 XML input stream. Returns a Perl hash. 🫢

like, one record at a time, she's not gonna dump the whole thing on you. hash in hand, ready to roll. keep calling her until she runs out.

🧚 _decode($record)

Deserialize a MAB2 XML record to an an ARRAY of ARRAYs. πŸ”₯

(the original really does say "an an ARRAY of ARRAYs" and honestly? iconic. we keep the facts, we keep the typo, we keep the lore. πŸ’€)


🌟 SEEALSO 🌟

  • Catmandu::Importer::MAB2. β€” go look at that one too, bestie, they're friends. 🌸

πŸŽ€ AUTHOR πŸŽ€

Johann Rolschewski <jorol@cpan.org> β€” the legend who made this. bow down. πŸ‘‘


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 yes, you can share her, remix her, whatever β€” same terms as Perl 5 itself. slay, legally. βš–οΈβœ¨

and that's the whole page, bestie!! πŸ¦‹ this was perl v5.36.0, dated 2022-12-04, and you found it under the manual page MAB2::...er::XML(3pm) (which is really MAB2::Parser::XML in the 3pm section, remember? 😭). mwah, go parse something gorgeous. πŸ’…πŸŽ€πŸ’–

πŸ“¦ where this page comes from