NAME
BibTeX::Parser - A plain perl BibTeX parser
VERSION
Version 0.1
SYNOPSIS
Parses BibTeX files.
use BibTeX::Parser;
my $fh = IO::File->new("filename");
# Create parser object ...
my $parser = BibTeX::Parser->new($fh);
# ... and iterate over entries
while (my $entry = $parser->next ) {
if ($entry->parse_ok) {
my $type = $entry->type;
my $title = $entry->field("title");
my @authors = $entry->authors;
# or:
my @editors = $entry->editors;
foreach my $author (@authors) {
print $author->first . " "
. $author->von . " "
. $author->last . ", "
. $author->jr;
}
} else {
warn "Error parsing file: " . $entry->error;
}
}
FUNCTIONS
new
Creates new parser object.
Parameters:
* fh: A filehandle
next
Returns the next parsed entry or undef.
AUTHOR
Gerhard Gossen, <gerhard.gossen at googlemail.com>
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.