NAME
Text::BibTeX::File - interface to whole BibTeX files
SYNOPSIS
use Text::BibTeX; # this loads Text::BibTeX::File
$bib = new Text::BibTeX::File "foo.bib" or die "foo.bib: $!\n";
OR
$bib = new Text::BibTeX::File;
$bib->open ("foo.bib") || die "foo.bib: $!\n";
$bib->set_structure ($structure_name,
$option1 => $value1, ...);
$at_eof = $bib->eof;
$bib->close;
DESCRIPTION
Text::BibTeX::File
provides a gratuitous object-oriented interface to BibTeX files. It really doesn't do much apart from keep track of a filename and filehandle together for use by the Text::BibTeX::Entry
module (which is much more interesting), but it provides a nice clean interface to which I might add functionality at some point.
METHODS
- new ([FILENAME [,MODE [,PERMS]]])
-
Creates a new
Text::BibTeX::File
object. IfFILENAME
is supplied, passes it to theopen
method (along withMODE
andPERMS
if they are supplied). If theopen
fails,new
fails and returns false; if theopen
succeeds (or ifFILENAME
isn't supplied),new
returns the new object reference. - open (FILENAME [,MODE [,PERMS]])
-
Opens the file specified by
FILENAME
, possibly usingMODE
andPERMS
(see IO::File for full semantics; thisopen
is just a front end forIO::File::open
). - close
-
Closes the filehandle associated with the object. If there is no such filehandle (ie. if you never called
open
on the object), does nothing.
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.