The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

BibTeX::Entry - Contains a single entry of a BibTeX document.

VERSION

version 0.3.2

SYNOPSIS

This class ist a wrapper for a single BibTeX entry. It is usually created by a BibTeX::Parser.

    use BibTeX::Parser::Entry;

    my $entry = BibTeX::Parser::Entry->new($type, $key, $parse_ok, \%fields);
    
    if ($entry->parse_ok) {
            my $type    = $entry->type;
            my $key     = $enty->key;
            print $entry->field("title");
            my @authors = $entry->author;
            my @editors = $entry->editor;

            ...
    }

FUNCTIONS

new

Create new entry.

parse_ok

If the entry was correctly parsed, this method returns a true value, false otherwise.

error

Return the error message, if the entry could not be parsed or undef otherwise.

type

Get or set the type of the entry, eg. 'ARTICLE' or 'BOOK'. Return value is always uppercase.

key

Get or set the reference key of the entry.

field($name [, $value])

Get or set the contents of a field. The first parameter is the name of the field, the second (optional) value is the new value.

author([@authors])

Get or set the authors. Returns an array of BibTeX::Author objects. The parameters can either be BibTeX::Author objects or strings.

Note: You can also change the authors with $entry->field('author', $authors_string)

editor([@editors])

Get or set the editors. Returns an array of BibTeX::Author objects. The parameters can either be BibTeX::Author objects or strings.

Note: You can also change the authors with $entry->field('editor', $editors_string)

fieldlist()

Returns a list of all the fields used in this entry.

has($fieldname)

Returns a true value if this entry has a value for $fieldname.

raw_bibtex

Return raw BibTeX entry (if available).