NAME

Text::BibTeX - interface to read and parse BibTeX files

SYNOPSIS

use Text::BibTeX;

$bibfile = new Text::BibTeX::File "foo.bib"
$newfile = new Text::BibTeX::File ">newfoo.bib"

while ($entry = new Text::BibTeX::Entry $bibfile)
{
   next unless $entry->parse_ok;

      .             # hack on $entry contents, using various
      .             # Text::BibTeX::Entry methods
      .

   $entry->put ($newfile);
}

DESCRIPTION

Text::BibTeX is just used to load the Text::BibTeX::File and Text::BibTeX::Entry modules, which are the ones that do all the real work (i.e., reading and parsing BibTeX files). (You shouldn't try to load Text::BibTeX::Entry on its own, though, because Text::BibTeX also loads the C code needed for parsing BibTeX files.)

The above synopsis shows one general approach for reading/parsing/writing BibTeX files; see Text::BibTeX::File and Text::BibTeX::Entry for full details on those two modules and their methods.

BUGS AND LIMITATIONS

How to deal with macro definitions (@string entries) from the Perl programmer's point of view is still a little fuzzy (and undocumented). Currently, macro expansions are stored in a hash table by the underlying C library, macros are expanded when entries are parsed. Macro expansion values are not yet available to Perl code.

AUTHOR

Greg Ward <greg@bic.mni.mcgill.ca>

COPYRIGHT

Copyright (c) 1997 by Gregory P. Ward. All rights reserved. This is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AVAILABILITY

The latest version of Text::BibTeX should be available from

ftp://ftp.bic.mni.mcgill.ca/pub/users/greg/

in Text-BibTeX-x.y.tar.gz, where x.y is the version number. You will also find the latest version of btparse, the C library underlying Text::BibTeX, at that location. It's not strictly necessary to get this separately, as the entire btparse distribution is currently included with Text::BibTeX. However, you might mention this to C programmers looking for a BibTeX solution, or indeed to anyone who could use a C solution to bind to high-level languages other than Perl. Also, in the future, I may include with Text::BibTeX only enough of btparse to build Text::BibTeX itself, in which case it could become useful to get the separate btparse distribution (eg. for documentation or examples).