Catman...BibTeX(3pm)

πŸ’– Catmandu::Importer::BibTeX β€” a BibTeX importer πŸ’–

okay bestie, so this is the page for Catmandu::Importer::BibTeX, living in the 3pm section of the manual (perl gang represent 🌸). It's the little importer that goes "bib file? say less" and hands you back nice lil hashrefs. Let's get into it ✨


🌈 SYNOPSIS

use Catmandu::Importer::BibTeX;

my $importer = Catmandu::Importer::BibTeX->new(file => "/foo/bar.bib");

my $n = $importer->each(sub {
    my $hashref = $_[0];
    # ...
});

like. look at her. four lines and she's already eating πŸ”₯ you use her, you build her with a file pointing at your .bib, and then you each over everything and do whatever your heart desires with each $hashref. the $n catches how many you went through. iconic behavior tbh πŸ‘‘


πŸ¦‹ DESCRIPTION

so here's the tea, and it's short but important: when this importer slurps up your BibTeX, the citekey and the reference type don't get shoved in like regular fields β€” nope β€” they land in their own special little spots:

  • the citekey comes in as the field _citekey πŸŽ€
  • the reference type comes in as the field _type πŸ’…

respectively, obviously. that leading underscore is doing heavy lifting β€” it's the "this came from the outside, not from the entry body" signal, iykyk 😌


🧚 METHODS

all the methods from Catmandu::Importer are inherited here β€” and by extension, every method from Catmandu::Iterable too, since Catmandu::Importer is that girl's child. so you're not just getting this importer, you're getting the whole family tree, no cap 🌳

fr fr: nothing extra is added on top, it's all inheritance, so go read those two if you want the full menu. this page is not the place to reinvent each, bestie 😭

🌸 SEE ALSO

  • Catmandu::Exporter::BibTeX β€” the mirror twin, the one who writes BibTeX instead of reading it πŸͺž
  • BibTeX::Parser β€” the parser doing the actual heavy lifting under the hood πŸ’ͺ

and that's the whole vibe check, bestie β€” go import something cute πŸ’–

this page came to you courtesy of perl v5.36.0, dated 2023-02-02, from the Catman...BibTeX(3pm) manual. mwah, take care of her 🫢

πŸ“¦ where this page comes from