Text::BibTeX::Validate(3pm)

Text::BibTeX::Validate3pm

Validator for bibtex format

Usage

    use Text::BibTeX;
    use Text::BibTeX::Validate qw( validate_BibTeX );
    my $bibfile = Text::BibTeX::File->new( 'bibliography.bib' );
    while( my $entry = Text::BibTeX::Entry->new( $bibfile ) ) {
        for my $warning (validate_BibTeX( $entry )) {
            print STDERR "$warning\n";
        }
    }

Overview

Text::BibTeX::Validate checks the standard fields of BibTeX entries for their compliance with their format. In particular, value of "email" is checked against RFC 822 mandated email address syntax, value of "doi" is checked to start with 10. and contain at least one "/" and so on. Some nonstandard fields as "isbn", "issn" and "url" are also checked. Failures of checks are returned as instances of Text::BibTeX::Validate::Warning.

Methods

validate_BibTeX( $what )

Takes plain Perl hash reference containing BibTeX fields and their values, as well as Text::BibTeX::Entry instances and returns an array of validation messages as instances of Text::BibTeX::Validate::Warning.

clean_BibTeX( $what )

Takes the same input as "validate_BibTeX" and attempts to reconcile trivial issues like dropping the resolver URL part of DOIs (see "shorten_DOI" method) and converting month numbers into three-letter abbreviations.

shorten_DOI( $doi )

Remove the resolver URL part, as well as "doi:" prefixes, from DOIs.

Releases

Unchanged in 2 releases since Debian 12 (Bookworm).

  1. 12–13

Authors

Andrius Merkys, <[email protected]>

From libtext-bibtex-validate-perl 0.3.0-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.