[btOOL] eof-Problems with Text::BibTeX and perl 5.8
Status: Beta
Brought to you by:
gward
|
From: Mark A. H. <ma...@cs...> - 2004-03-30 08:55:22
|
Hi!
Lately I have been converting to perl 5.8 and a problem with
Text::BibTeX has been bugging me ever since: when scanning through a
.bib-file end-of-file conditions are not detected.
The following program using bibloop() (which checks for eof())
exhibits the problem (and a bit of additional information):
#!/usr/bin/perl
use Text::BibTeX;
use Data::Dumper;
use Fcntl 'SEEK_CUR';
$Data::Dumper::Maxdepth = 1;
Text::BibTeX::bibloop( sub {
printf "%s\ntell %d\nsystell %d\n",
Dumper($_[0]),
$_[0]{file}{handle}->tell,
$_[0]{file}{handle}->sysseek(0,SEEK_CUR);
}, \@ARGV );
Basically, when I pass it a .bib-file, perl's internal file pointer
(told by tell()) advances from 0 to the start of the second record in
that .bib-file and then stays at that value. New entries are still read
but the end-of-file is not detected, so the program finally dies with
the message "Can't call method "parse_ok" without a package or object reference at
blib/lib/Text/BibTeX.pm line 400.".
I have tracked the problem with the perl debugger until it calls an XSUB
and then the appropriate routine in the library. With perl 5.6, the
position in the filehandle would advance after that calls completes (or
so I guess), with perl 5.8 it does not. As I am not familiar with XS /
XSUBs, I have no idea where to go from here.
Has anybody else experienced this problem?
Find attached the outputs (including version information) of runs with
perl 5.6 and perl 5.8 as well as the programme and a sample .bib file.
Regards, Mark
--
Mark A. Hillebrand Saarland University
Computer Science Department Institute for Computer Architecture
Phone: +49 (0)681 302 2036 Fax: 49 (0)681 302 4290
Email: ma...@cs... WWW: http://www-wjp.cs.uni-sb.de/
|