Code Monkey home page Code Monkey logo

text-bibtex's Introduction

  Text::BibTeX
---------------------------------------------------------------------------

  Text::BibTeX is a Perl library for reading, parsing, and processing
  BibTeX files.  It is the Perl half of btOOL, a pair of libraries for
  dealing with BibTeX data.

  Text::BibTeX gives you access to the data at many different levels:
  you may work with BibTeX entries as simple "field -> string"
  mappings, or get at the original form of the data as a list of
  simple values (strings, macros, or numbers) pasted together.  You
  can choose not to impose nany restrictions on the allowed/expected
  entry types or fields, or you can use the structure defined by
  BibTeX 0.99's standard style files, or you can invent your own.

  The library is copiously documented.  After installing the module,
  see the Text::BibTeX man page for a comprehensive introduction to
  the system.  If you wish to dive straight in without regards for
  niceties such as splitting and formatting names, defining or
  imposing database structures, getting access to unprocessed field
  values, and other nifty features, then you can probably get away
  with just reading the Text::BibTeX::Entry man page.
  Comments/criticism of the documentation are welcome.


  In addition to the man pages embedded in each module (and available
  after installation), Greg Ward has written a technical report
  describing btOOL, with the btparse and Text::BibTeX documentation
  included as appendices.  The whole report is just over 100 pages,
  around 45 of which make up the Text::BibTeX documentation (the
  btparse documentation is a further 30 pages).  You can find it at
  the btOOL home page:

    http://www.gerg.ca/software/btOOL/


  INSTALLATION
---------------------------------------------------------------------------

  To install Text::BibTeX you need a recent Perl, an ANSI-compliant C
  compiler and a bunch of Perl modules.

  The build system changed with version 0.40, and has been tested in
  different platforms, ranging from Linux, Mac OS X, Solaris and
  Windows. Unfortunately on this last just the Strawberry Perl
  distribution was a success.

  To build the module use the usual set of commands for a
  Module::Build distribution:

    perl Build.PL
    ./Build
    ./Build test

  And then, as super user, install it

    ./Build install

  Note that if your Perl is installed in a non standard path you can
  end up with libbtparse library in the wrong place. If the tests pass
  successfully, but after installing you can not issue

    perl -MText::BibTeX

  without an error message, then probably libbtparse is not reachable
  by the library loader. In this case you can either copy the library
  to the proper place or add the path to the library in the
  LD_LIBARY_PATH environment variable.

text-bibtex's People

Contributors

ambs avatar andreas-schwab avatar cbm755 avatar crissov avatar daleevans avatar kwwette avatar nunorc avatar plk avatar sergeyromanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

text-bibtex's Issues

Is there any way to make the parentheses and space be contained in bibtex entrykey?

Is there any way to make the parentheses and space be contained in bibtex entrykey?

hello

I am a biblatex/biber user, and encountered an error while biber was parsing the bib file, which contained entries with entriekey containing () or ' ', the biber/biblatex author told me that it was caused by btparse(biber use btparse), so I am here to ask about some improvement or measure to overcome this problem.

for an entry:

@misc{Euclidean_geometry(hi),
howpublished = {https://zh.wikipedia.org/wiki/abc},
title = {Euclidean geometry},
}

the biber output is:

INFO - This is Biber 2.12
INFO - Logfile is 'egtest.blg'
INFO - Reading 'egtest.bcf'
INFO - Using all citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'egtest.bib' for section 0
INFO - LaTeX decoding ...
INFO - Found BibTeX data source 'egtest.bib'
WARN - BibTeX subsystem: C:\Users\ADMINI~1\AppData\Local\Temp\CQM6OZvJS8\egtest.
bib_2912.utf8, line 6, warning: "(" in strange place -- should get a syntax erro
r
ERROR - BibTeX subsystem: C:\Users\ADMINI~1\AppData\Local\Temp\CQM6OZvJS8\egtest
.bib_2912.utf8, line 6, syntax error: found "(", expected ","
INFO - WARNINGS: 1
INFO - ERRORS: 1

and for an entry:

@misc{how are you,
howpublished = {{www.baidu.com}},
title = {how are you},
}

the biber output is:

INFO - This is Biber 2.12
INFO - Logfile is 'egtest4.blg'
INFO - Reading 'egtest4.bcf'
INFO - Using all citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'egtest4.bib' for section 0
INFO - LaTeX decoding ...
INFO - Found BibTeX data source 'egtest4.bib'
ERROR - BibTeX subsystem: C:\Users\ADMINI~1\AppData\Local\Temp\Y796C4jmpi\egtest
4.bib_6436.utf8, line 11, syntax error: found "are", expected ","
INFO - ERRORS: 1

Warning during self-tests

When running the self tests for 0.80 with perl-5.24.1, they all succeed but there are warnings in the middle:

** Preparing XS code
t/bib.t ......... ok
t/from_file.t ... 1/11 t/errors.bib, line 2, syntax error: found "{error}", expected "="
t/from_file.t ... ok
t/macro.t ....... ok
t/modify.t ...... ok
t/nameformat.t .. ok
t/namelist.t .... 2/12 substring 2, warning: empty substring
t/namelist.t .... ok
t/names.t ....... ok
t/output.t ...... ok
t/parse.t ....... ok
t/parse_f.t ..... ok
t/parse_s.t ..... 1/50 line 1, syntax error: at end of input, expected "@"
line 1, syntax error: at end of input, expected "@"
t/parse_s.t ..... ok
t/purify.t ...... ok
All tests successful.
Files=12, Tests=533,  1 wallclock secs ( 0.06 usr  0.04 sys +  0.82 cusr  0.21 csys =  1.13 CPU)
Result: PASS

Try to reduce memory mount from C code

some strings after getting from C, are not being freed by the garbage collector.
Not a big issue, as we deal with small strings, and even with some thousand bibtex entris, memory only raises to 80MB or so... but keeping this ticket just to remind of the problem

all lowercase names

When a name is all lowercase and has a comma, such as
author="shelat, abhi"
it is parsed as:
<first>abhi</first><von>shelat abhi</von><last></last>
Note that one of the words is duplicated

With no comma, it seems fine.
author="abhi shelat"
is parsed as:
<first></first><von>abhi</von><last>shelat</last>
which is the same thing that BibTeX does.

Problem with double last name parsing

There appears to be a problem with parsing double last names, which in some cases produces an "internal error: bad token join method" error. I've pushed a branch reproducing the problem here:

https://github.com/kwwette/Text-BibTeX/tree/nameformat-bug

Note that since the error comes from accessing out-of-bounds memory, the test doesn't fail every time, but if you run "./Build test" a few times it should fail.

For completeness the patch is also here:

https://gist.github.com/kwwette/d07dee95faa8cc0522fb3d4b3cb82bbc

ld 2.3.0 doesn't recognize -Wl,-soname

I'm building Text::BibTeX manually with an almost-static build of Perl in order to eventually port biber to WebAssembly. Getting build errors from Text::BibTeX. Could you advise how to hack around the build script?

ld -o btparse/src/libbtparse.so btparse/src/init.o btparse/src/input.o btparse/src/bibtex.o btparse/src/err.o btparse/src/scan.o btparse/src/error.o btparse/src/lex_auxiliary.o btparse/src/parse_auxiliary.o btparse/src/bibtex_ast.o btparse/src/sym.o btparse/src/util.o btparse/src/postprocess.o btparse/src/macros.o btparse/src/traversal.o btparse/src/modify.o btparse/src/names.o btparse/src/tex_tree.o btparse/src/string_util.o btparse/src/format_name.o -Wl,-soname=libbtparse.so
#ld: unrecognized option '-Wl,-soname=libbtparse.so'

ld -o btparse/src/libbtparse.so btparse/src/init.o btparse/src/input.o btparse/src/bibtex.o btparse/src/err.o btparse/src/scan.o btparse/src/error.o btparse/src/lex_auxiliary.o btparse/src/parse_auxiliary.o btparse/src/bibtex_ast.o btparse/src/sym.o btparse/src/util.o btparse/src/postprocess.o btparse/src/macros.o btparse/src/traversal.o btparse/src/modify.o btparse/src/names.o btparse/src/tex_tree.o btparse/src/string_util.o btparse/src/format_name.o
# ld: warning: cannot find entry symbol _start; defaulting to 0000000000400120
# btparse/src/input.o: In function `bt_parse_entry_s':
# input.c:(.text+0x1db): undefined reference to `free'
# input.c:(.text+0x20e): undefined reference to `__stack_chk_fail'

ld -o btparse/src/libbtparse.so btparse/src/init.o btparse/src/input.o btparse/src/bibtex.o btparse/src/err.o btparse/src/scan.o btparse/src/error.o btparse/src/lex_auxiliary.o btparse/src/parse_auxiliary.o btparse/src/bibtex_ast.o btparse/src/sym.o btparse/src/util.o btparse/src/postprocess.o btparse/src/macros.o btparse/src/traversal.o btparse/src/modify.o btparse/src/names.o btparse/src/tex_tree.o btparse/src/string_util.o btparse/src/format_name.o -lc
# ld: warning: cannot find entry symbol _start; defaulting to 0000000000400f00

Buid on Windows10 and MSVC

Hi,

Building Text::BibTex with MSVC fails with:
`
cpan[2]> install Text::BibTeX
Running install for module 'Text::BibTeX'
Checksum for C:\Users\user.cpan\sources\authors\id\A\AM\AMBS\Text-BibTeX-0.88.tar.gz ok
Scanning cache C:\Users\user.cpan\build for sizes
............................................................................DONE
'YAML' not installed, will not store persistent state
Configuring A/AM/AMBS/Text-BibTeX-0.88.tar.gz with Build.PL
compilet-5SWjN.c
Création de la bibliothèque compilet.lib et de l'objet compilet.exp
Génération de code en cours
Fin de la génération du code
libbtparse.dll will be installed in C:\CraftRoot\dev-utils\bin
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Text-BibTeX' version '0.88'
AMBS/Text-BibTeX-0.88.tar.gz
C:\CraftRoot\bin\perl.exe Build.PL -- OK
Running Build for A/AM/AMBS/Text-BibTeX-0.88.tar.gz
Building Text-BibTeX
Generating script 'C:\Users\user\AppData\Local\Temp\2pAmAg7MZG\library.ccs'
cl -nologo -c @"C:\Users\user\AppData\Local\Temp\2pAmAg7MZG\library.ccs" -Fo"C:\Users\user\AppData\Local\Temp\2pAmAg7MZG\library.obj" "C:\Users\user\AppData\Local\Temp\2pAmAg7MZG\library.c"
library.c
Generating script 'C:\Users\user\AppData\Local\Temp\2pAmAg7MZG\test.ccs'
cl -nologo -c @"C:\Users\user\AppData\Local\Temp\2pAmAg7MZG\test.ccs" -Fo"C:\Users\user\AppData\Local\Temp\2pAmAg7MZG\test.obj" "C:\Users\user\AppData\Local\Temp\2pAmAg7MZG\test.c"
test.c
Microsoft (R) Incremental Linker Version 14.28.29336.0
Copyright (C) Microsoft Corporation. All rights reserved.

LINK : warning LNK4044: option '/shared' non reconnue ; ignorée
LINK : warning LNK4044: option '/o' non reconnue ; ignorée
LINK : fatal error LNK1181: impossible d'ouvrir le fichier en entrée 'C:\Users\user\AppData\Local\Temp\2pAmAg7MZG\libfoo.dll'
Checking for alloca.h... Checking for cc... compilet-Ql5nu.c
Création de la bibliothèque compilet.lib et de l'objet compilet.exp
Génération de code en cours
Fin de la génération du code
cl
no
Checking for vsnprintf... no
Checking for strlcat... no
Creating new 'btparse/src/bt_config.h' from 'btparse/src/bt_config.h.in'.

** Creating Manpages

** Compiling C files
Generating script 'btparse\progs\args.ccs'
cl -nologo -c @"btparse\progs\args.ccs" -Fo"btparse\progs\args.o" "btparse\progs\args.c"
args.c
Generating script 'btparse\progs\biblex.ccs'
cl -nologo -c @"btparse\progs\biblex.ccs" -Fo"btparse\progs\biblex.o" "btparse\progs\biblex.c"
biblex.c
btparse\progs\biblex.c(52): warning C4013: 'exit' non défini(e) ; extern retournant int pris par défaut
Generating script 'btparse\progs\bibparse.ccs'
cl -nologo -c @"btparse\progs\bibparse.ccs" -Fo"btparse\progs\bibparse.o" "btparse\progs\bibparse.c"
bibparse.c
Generating script 'btparse\progs\dumpnames.ccs'
cl -nologo -c @"btparse\progs\dumpnames.ccs" -Fo"btparse\progs\dumpnames.o" "btparse\progs\dumpnames.c"
dumpnames.c
Generating script 'btparse\progs\getopt.ccs'
cl -nologo -c @"btparse\progs\getopt.ccs" -Fo"btparse\progs\getopt.o" "btparse\progs\getopt.c"
getopt.c
Generating script 'btparse\progs\getopt1.ccs'
cl -nologo -c @"btparse\progs\getopt1.ccs" -Fo"btparse\progs\getopt1.o" "btparse\progs\getopt1.c"
getopt1.c
Generating script 'btparse\src\bibtex.ccs'
cl -nologo -c @"btparse\src\bibtex.ccs" -Fo"btparse\src\bibtex.o" "btparse\src\bibtex.c"
bibtex.c
C:\Users\user.cpan\build\Text-BibTeX-0.88-2\btparse\src../pccts/ast.c(82): warning C4013: 'exit' non défini(e) ; extern retournant int pris par défaut
C:\Users\user.cpan\build\Text-BibTeX-0.88-2\btparse\src../pccts/ast.c(192): error C2061: erreur de syntaxe : identificateur 'va_dcl'
C:\Users\user.cpan\build\Text-BibTeX-0.88-2\btparse\src../pccts/ast.c(192): error C2059: erreur de syntaxe : ';'C:\Users\user.cpan\build\Text-BibTeX-0.88-2\btparse\src../pccts/ast.c(194): error C2449: trouvé '{' au niveau de la portée du fichier (en-tête de fonction manquant ?)
C:\Users\user.cpan\build\Text-BibTeX-0.88-2\btparse\src../pccts/ast.c(203): warning C4003: pas assez d'arguments pour l'appel de macro de type fonction '__crt_va_start'
C:\Users\user.cpan\build\Text-BibTeX-0.88-2\btparse\src../pccts/ast.c(221): error C2059: erreur de syntaxe : '}'C:\Users\user.cpan\build\Text-BibTeX-0.88-2\btparse\src../pccts/ast.c(230): error C2449: trouvé '{' au niveau de la portée du fichier (en-tête de fonction manquant ?)
C:\Users\user.cpan\build\Text-BibTeX-0.88-2\btparse\src../pccts/ast.c(247): error C2059: erreur de syntaxe : '}'C:\Users\user.cpan\build\Text-BibTeX-0.88-2\btparse\src../pccts/ast.c(255): error C2449: trouvé '{' au niveau de la portée du fichier (en-tête de fonction manquant ?)
C:\Users\user.cpan\build\Text-BibTeX-0.88-2\btparse\src../pccts/ast.c(260): error C2059: erreur de syntaxe : '}'error building dll file from 'btparse/src/bibtex.c' at C:/CraftRoot/lib/ExtUtils/CBuilder/Platform/Windows.pm line 128.
AMBS/Text-BibTeX-0.88.tar.gz
C:\CraftRoot\bin\perl.exe ./Build -- NOT OK
Failed during this command:
AMBS/Text-BibTeX-0.88.tar.gz : make NO

cpan[3]>
`
Regards

Reading from strings or string-based file handles

I expected one of this to work:

open my $fh, '<', \$somestringwithbibtexdata;
Text::BibTeX::bibloop( sub { }, [$fh] );

Text::BibTeX::bibloop( sub { }, [\$somestringwithbibtexdata] );

Perl supports file handles based on string data since long ago.

Release

Hi, following ef299ab it would be great to have a new release so that the fixed header files get distributed.
Thank you!

month field should support month abbrevs

Accordingly with an RT ticket, we should parse correctly lines like:

    month = aug,

without any quotes. So, for the 12 months.

@plk, do you have some time to dig how to support this in the generated parser?

t/unlimited.t test failing on non-x86 arch

I'm packaging for Fedora. The new unlimited.t test seems to be failed on arm, powerpc and "aarch64".

t/bib.t ......... ok
t/from_file.t ... ok
t/macro.t ....... ok
t/modify.t ...... ok
t/nameformat.t .. ok
t/namelist.t .... ok
t/names.t ....... ok
t/output.t ...... ok
t/parse.t ....... ok
t/parse_f.t ..... ok
t/parse_s.t ..... ok
t/purify.t ...... ok
t/unlimited.t ... 
All 4 subtests passed 
Test Summary Report
-------------------
t/unlimited.t (Wstat: 139 Tests: 4 Failed: 0)
  Non-zero wait status: 139
Files=13, Tests=544,  6 wallclock secs ( 0.29 usr  0.08 sys +  4.68 cusr  0.75 csys =  5.80 CPU)
Result: FAIL
Failed 1/13 test programs. 0/544 subtests failed.

Will see if I can dig a little deeper...

Buildsystem: export C-header files

If I get it right, atm only libbtparse.so is installed and not the header files. This effect of this is, that the binaries included in Text-BibTeX will work, but other programs that use btparse directly cannot be compiled against Text-BibTeX. Nevertheless due to the fact, that libbtparse.so is installed, it prevents the systemwide installation of old ptparse.

It would be nice, if you include an (maybe optional) export of btparse.h and the creation of a pkg-config file (the old btparse seems to create libbtparse.a and libbtparse.la as well, I get this from this list).

In fact distributions like Debian seems to patch this in the appropriate way already.

Cannot install version >= 0.86 using cpanm

When I try to install Text:BibTeX using cpanm, I get the error (full verbosity enabled) as presented below. Could you please investigate?

Link to full Installation log
I tried this with perl 5.22 and 5.28.

Building Text-BibTeX-0.86 ... Building Text-BibTeX
cc -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o /tmp/s8Wz4yClp1/library.o /tmp/s8Wz4yClp1/library.c
cc -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o /tmp/s8Wz4yClp1/test.o /tmp/s8Wz4yClp1/test.c
cc -shared -O2 -L/usr/local/lib -fstack-protector -o /tmp/s8Wz4yClp1/libfoo.so /tmp/s8Wz4yClp1/library.o
cc -fstack-protector -L/usr/local/lib -o /tmp/s8Wz4yClp1/foo /tmp/s8Wz4yClp1/test.o -L/tmp/s8Wz4yClp1 -lfoo
Checking for alloca.h... Checking for cc... cc
yes
Checking for vsnprintf... yes
Checking for strlcat... no
Creating new 'btparse/src/bt_config.h' from 'btparse/src/bt_config.h.in'.

** Creating Manpages

** Compiling C files
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/progs/getopt.o btparse/progs/getopt.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/progs/dumpnames.o btparse/progs/dumpnames.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/progs/args.o btparse/progs/args.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/progs/getopt1.o btparse/progs/getopt1.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/progs/biblex.o btparse/progs/biblex.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/progs/bibparse.o btparse/progs/bibparse.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/macros.o btparse/src/macros.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/bibtex.o btparse/src/bibtex.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/modify.o btparse/src/modify.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/parse_auxiliary.o btparse/src/parse_auxiliary.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/file_header.o btparse/src/file_header.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/format_name.o btparse/src/format_name.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/tex_tree.o btparse/src/tex_tree.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/names.o btparse/src/names.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/lex_auxiliary.o btparse/src/lex_auxiliary.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/string_util.o btparse/src/string_util.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/init.o btparse/src/init.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/err.o btparse/src/err.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/function_header.o btparse/src/function_header.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/scan.o btparse/src/scan.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/util.o btparse/src/util.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/traversal.o btparse/src/traversal.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/line_offsets.o btparse/src/line_offsets.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/postprocess.o btparse/src/postprocess.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/sym.o btparse/src/sym.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/bibtex_ast.o btparse/src/bibtex_ast.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/error.o btparse/src/error.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/src/input.o btparse/src/input.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/tests/testlib.o btparse/tests/testlib.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/tests/tex_test.o btparse/tests/tex_test.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
cc -Ibtparse/src -I/home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/x86_64-linux/CORE -fPIC -D_FORTIFY_SOURCE=1 -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o btparse/tests/namebug.o btparse/tests/namebug.c
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
btparse/tests/namebug.c: In function ‘test_parsename’:
btparse/tests/namebug.c:193:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < parse_string_count; ++i) {
  ^
btparse/tests/namebug.c:193:2: note: use option -std=c99 or -std=gnu99 to compile your code
error building btparse/tests/namebug.o from 'btparse/tests/namebug.c' at /home/travis/perl5/perlbrew/perls/5.22.0/lib/5.22.0/ExtUtils/CBuilder/Base.pm line 173.
FAIL
! Installing Text::BibTeX failed. See /home/travis/.cpanm/work/1556548718.10441/build.log for details. Retry with --force to force install it.

[question] how to support aliases for entry types

Hello,

I need to parse a BibTeX file which, in addition to the standard types, also contains some custom entry types, such as 'slides', 'lecturenotes' etc. which all have exactly the same constraints as the entry type 'misc'. Could you please give me some pointers on how to achieve this?

I already skimmed the documentation about setting up a custom structure but have a feeling that it can be done in a couple of lines by inheriting from Text::BibTeX::BibEntry (all the custom types are basically just aliases for 'misc').

Thanks a lot in advance!

Some tests failing on Solaris

Test failures with 0.75_01 (trivial fix)

Nearly all the tests fail for me. This appears to be caused by a single line that also yields this warning for me:

Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.

The line is

@x = map {defined ? Text::BibTeX->_process_result($_, $self->{binmode}): undef} @x;

If I change it to

@x = map {defined($_) ? Text::BibTeX->_process_result($_, $self->{binmode}): undef} @x;

the warning goes away and all tests pass:

** Preparing XS code
t/bib.t ......... ok     
t/from_file.t ... ok   
t/macro.t ....... ok     
t/modify.t ...... ok     
t/nameformat.t .. ok     
t/namelist.t .... 1/12 substring 2, warning: empty substring
t/namelist.t .... ok     
t/names.t ....... ok     
t/output.t ...... ok     
t/parse.t ....... ok     
t/parse_f.t ..... ok     
t/parse_s.t ..... ok     
t/purify.t ...... ok       
All tests successful.
Files=12, Tests=513,  1 wallclock secs ( 0.09 usr  0.03 sys +  0.86 cusr  0.17 csys =  1.15 CPU)
Result: PASS

For comparison, this is what I get if I leave the line as-is:

** Preparing XS code
t/bib.t ......... Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Use of ?PATTERN? without explicit operator is deprecated at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Array found where operator expected at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? "
  (Might be a runaway multi-line ?? string starting on line 509)
    (Do you need to predeclare return?)
t/bib.t ......... 1/42 
#   Failed test 'use Text::BibTeX;'
#   at t/bib.t line 12.
#     Tried to use 'Text::BibTeX'.
#     Error:  syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? @x "
# syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 514, near "sub value "
# Missing right curly or square bracket at <path>/blib/lib/Text/BibTeX/Entry.pm line 1035, at end of line
# Compilation failed in require at <path>/blib/lib/Text/BibTeX.pm line 253.
# Compilation failed in require at t/bib.t line 12.
# BEGIN failed--compilation aborted at t/bib.t line 12.

#   Failed test 'use Text::BibTeX::Bib;'
#   at t/bib.t line 13.
#     Tried to use 'Text::BibTeX::Bib'.
#     Error:  Attempt to reload Text/BibTeX.pm aborted.
# Compilation failed in require at <path>/blib/lib/Text/BibTeX/Structure.pm line 29.
# BEGIN failed--compilation aborted at <path>/blib/lib/Text/BibTeX/Structure.pm line 29.
# Compilation failed in require at <path>/blib/lib/Text/BibTeX/BibSort.pm line 23.
# BEGIN failed--compilation aborted at <path>/blib/lib/Text/BibTeX/BibSort.pm line 23.
# Compilation failed in require at <path>/blib/lib/Text/BibTeX/Bib.pm line 455.
# BEGIN failed--compilation aborted at <path>/blib/lib/Text/BibTeX/Bib.pm line 455.
# Compilation failed in require at t/bib.t line 13.
# BEGIN failed--compilation aborted at t/bib.t line 13.
Attempt to reload Text/BibTeX/Structure.pm aborted.
Compilation failed in require at <path>/blib/lib/Text/BibTeX/File.pm line 193.
Unknown Text::BibTeX function: "cleanup" at <path>/blib/lib/Text/BibTeX/File.pm line 193.
END failed--call queue aborted at t/bib.t line 193.
# Looks like your test exited with 22 just after 2.
t/bib.t ......... Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 42/42 subtests 
t/from_file.t ... Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Use of ?PATTERN? without explicit operator is deprecated at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Array found where operator expected at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? "
  (Might be a runaway multi-line ?? string starting on line 509)
    (Do you need to predeclare return?)
syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? @x "
syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 514, near "sub value "
Missing right curly or square bracket at <path>/blib/lib/Text/BibTeX/Entry.pm line 1035, at end of line
Compilation failed in require at <path>/blib/lib/Text/BibTeX.pm line 253.
Compilation failed in require at t/from_file.t line 7.
BEGIN failed--compilation aborted at t/from_file.t line 7.
Unknown Text::BibTeX function: "cleanup" at t/from_file.t line 7.
END failed--call queue aborted at t/from_file.t line 7.
# Looks like your test exited with 22 before it could output anything.
t/from_file.t ... Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 5/5 subtests 
t/macro.t ....... Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Use of ?PATTERN? without explicit operator is deprecated at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Array found where operator expected at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? "
  (Might be a runaway multi-line ?? string starting on line 509)
    (Do you need to predeclare return?)
t/macro.t ....... 1/57 
#   Failed test 'use Text::BibTeX;'
#   at t/macro.t line 10.
#     Tried to use 'Text::BibTeX'.
#     Error:  syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? @x "
# syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 514, near "sub value "
# Missing right curly or square bracket at <path>/blib/lib/Text/BibTeX/Entry.pm line 1035, at end of line
# Compilation failed in require at <path>/blib/lib/Text/BibTeX.pm line 253.
# Compilation failed in require at t/macro.t line 10.
# BEGIN failed--compilation aborted at t/macro.t line 10.
Undefined subroutine &main::macro_length called at t/macro.t line 45.
Unknown Text::BibTeX function: "cleanup" at t/macro.t line 45.
END failed--call queue aborted at t/macro.t line 45.
# Looks like your test exited with 22 just after 1.
t/macro.t ....... Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 57/57 subtests 
t/modify.t ...... Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Use of ?PATTERN? without explicit operator is deprecated at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Array found where operator expected at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? "
  (Might be a runaway multi-line ?? string starting on line 509)
    (Do you need to predeclare return?)
t/modify.t ...... 1/29 
#   Failed test 'use Text::BibTeX;'
#   at t/modify.t line 9.
#     Tried to use 'Text::BibTeX'.
#     Error:  syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? @x "
# syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 514, near "sub value "
# Missing right curly or square bracket at <path>/blib/lib/Text/BibTeX/Entry.pm line 1035, at end of line
# Compilation failed in require at <path>/blib/lib/Text/BibTeX.pm line 253.
# Compilation failed in require at t/modify.t line 9.
# BEGIN failed--compilation aborted at t/modify.t line 9.
Undefined subroutine &Text::BibTeX::Entry::_parse_s called at <path>/blib/lib/Text/BibTeX/Entry.pm line 350.
Unknown Text::BibTeX function: "cleanup" at <path>/blib/lib/Text/BibTeX/Entry.pm line 350.
END failed--call queue aborted at t/modify.t line 350.
# Looks like your test exited with 22 just after 2.
t/modify.t ...... Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 28/29 subtests 
t/nameformat.t .. Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Use of ?PATTERN? without explicit operator is deprecated at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Array found where operator expected at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? "
  (Might be a runaway multi-line ?? string starting on line 509)
    (Do you need to predeclare return?)
syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? @x "
syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 514, near "sub value "
Missing right curly or square bracket at <path>/blib/lib/Text/BibTeX/Entry.pm line 1035, at end of line
Compilation failed in require at <path>/blib/lib/Text/BibTeX.pm line 253.
Compilation failed in require at t/nameformat.t line 12.
BEGIN failed--compilation aborted at t/nameformat.t line 12.
Unknown Text::BibTeX function: "cleanup" at t/nameformat.t line 12.
END failed--call queue aborted at t/nameformat.t line 12.
# Looks like your test exited with 22 before it could output anything.
t/nameformat.t .. Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 26/26 subtests 
t/namelist.t .... Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Use of ?PATTERN? without explicit operator is deprecated at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Array found where operator expected at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? "
  (Might be a runaway multi-line ?? string starting on line 509)
    (Do you need to predeclare return?)
t/namelist.t .... 1/12 
#   Failed test 'use Text::BibTeX;'
#   at t/namelist.t line 11.
#     Tried to use 'Text::BibTeX'.
#     Error:  syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? @x "
# syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 514, near "sub value "
# Missing right curly or square bracket at <path>/blib/lib/Text/BibTeX/Entry.pm line 1035, at end of line
# Compilation failed in require at <path>/blib/lib/Text/BibTeX.pm line 253.
# Compilation failed in require at t/namelist.t line 11.
# BEGIN failed--compilation aborted at t/namelist.t line 11.
Unknown Text::BibTeX function: "split_list" at t/namelist.t line 38.
Unknown Text::BibTeX function: "cleanup" at <path>/blib/lib/Text/BibTeX.pm line 242.
    Text::BibTeX::AUTOLOAD called at <path>/blib/lib/Text/BibTeX.pm line 268
    Text::BibTeX::END() called at /Users/pipping/perl5/lib/perl5/Carp.pm line 167
    eval {...} called at /Users/pipping/perl5/lib/perl5/Carp.pm line 167
END failed--call queue aborted at t/namelist.t line 167.
# Looks like your test exited with 22 just after 1.
t/namelist.t .... Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 12/12 subtests 
t/names.t ....... Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Use of ?PATTERN? without explicit operator is deprecated at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Array found where operator expected at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? "
  (Might be a runaway multi-line ?? string starting on line 509)
    (Do you need to predeclare return?)
syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? @x "
syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 514, near "sub value "
Missing right curly or square bracket at <path>/blib/lib/Text/BibTeX/Entry.pm line 1035, at end of line
Compilation failed in require at <path>/blib/lib/Text/BibTeX.pm line 253.
Compilation failed in require at t/names.t line 10.
BEGIN failed--compilation aborted at t/names.t line 10.
Unknown Text::BibTeX function: "cleanup" at t/names.t line 10.
END failed--call queue aborted at t/names.t line 10.
# Looks like your test exited with 22 before it could output anything.
t/names.t ....... Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 61/61 subtests 
t/output.t ...... Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Use of ?PATTERN? without explicit operator is deprecated at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Array found where operator expected at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? "
  (Might be a runaway multi-line ?? string starting on line 509)
    (Do you need to predeclare return?)
t/output.t ...... 1/20 
#   Failed test 'use Text::BibTeX;'
#   at t/output.t line 11.
#     Tried to use 'Text::BibTeX'.
#     Error:  syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? @x "
# syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 514, near "sub value "
# Missing right curly or square bracket at <path>/blib/lib/Text/BibTeX/Entry.pm line 1035, at end of line
# Compilation failed in require at <path>/blib/lib/Text/BibTeX.pm line 253.
# Compilation failed in require at t/output.t line 11.
# BEGIN failed--compilation aborted at t/output.t line 11.
Undefined subroutine &Text::BibTeX::Entry::_parse_s called at <path>/blib/lib/Text/BibTeX/Entry.pm line 350.
Unknown Text::BibTeX function: "cleanup" at <path>/blib/lib/Text/BibTeX/Entry.pm line 350.
END failed--call queue aborted at t/output.t line 350.
# Looks like your test exited with 22 just after 1.
t/output.t ...... Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 20/20 subtests 
t/parse.t ....... Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Use of ?PATTERN? without explicit operator is deprecated at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Array found where operator expected at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? "
  (Might be a runaway multi-line ?? string starting on line 509)
    (Do you need to predeclare return?)
t/parse.t ....... 1/32 
#   Failed test 'use Text::BibTeX;'
#   at t/parse.t line 12.
#     Tried to use 'Text::BibTeX'.
#     Error:  syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? @x "
# syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 514, near "sub value "
# Missing right curly or square bracket at <path>/blib/lib/Text/BibTeX/Entry.pm line 1035, at end of line
# Compilation failed in require at <path>/blib/lib/Text/BibTeX.pm line 253.
# Compilation failed in require at t/parse.t line 12.
# BEGIN failed--compilation aborted at t/parse.t line 12.
Bareword "BTE_COMMENT" not allowed while "strict subs" in use at t/parse.t line 40.
Bareword "BTE_PREAMBLE" not allowed while "strict subs" in use at t/parse.t line 46.
Execution of t/parse.t aborted due to compilation errors.
Unknown Text::BibTeX function: "cleanup" at t/parse.t line 51.
END failed--call queue aborted at t/parse.t line 51.
# Looks like your test exited with 22 just after 1.
t/parse.t ....... Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 32/32 subtests 
t/parse_f.t ..... Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Use of ?PATTERN? without explicit operator is deprecated at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Array found where operator expected at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? "
  (Might be a runaway multi-line ?? string starting on line 509)
    (Do you need to predeclare return?)
t/parse_f.t ..... 1/73 
#   Failed test 'use Text::BibTeX;'
#   at t/parse_f.t line 11.
#     Tried to use 'Text::BibTeX'.
#     Error:  syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? @x "
# syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 514, near "sub value "
# Missing right curly or square bracket at <path>/blib/lib/Text/BibTeX/Entry.pm line 1035, at end of line
# Compilation failed in require at <path>/blib/lib/Text/BibTeX.pm line 253.
# Compilation failed in require at t/parse_f.t line 11.
# BEGIN failed--compilation aborted at t/parse_f.t line 11.
Undefined subroutine &Text::BibTeX::Entry::_parse called at <path>/blib/lib/Text/BibTeX/Entry.pm line 341.
Unknown Text::BibTeX function: "cleanup" at /System/Library/Perl/Extras/5.18/Capture/Tiny.pm line 392.
END failed--call queue aborted at t/parse_f.t line 392.
# Looks like your test exited with 22 just after 1.
t/parse_f.t ..... Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 73/73 subtests 
t/parse_s.t ..... Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Use of ?PATTERN? without explicit operator is deprecated at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Array found where operator expected at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? "
  (Might be a runaway multi-line ?? string starting on line 509)
    (Do you need to predeclare return?)
t/parse_s.t ..... 1/46 
#   Failed test 'use Text::BibTeX;'
#   at t/parse_s.t line 11.
#     Tried to use 'Text::BibTeX'.
#     Error:  syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? @x "
# syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 514, near "sub value "
# Missing right curly or square bracket at <path>/blib/lib/Text/BibTeX/Entry.pm line 1035, at end of line
# Compilation failed in require at <path>/blib/lib/Text/BibTeX.pm line 253.
# Compilation failed in require at t/parse_s.t line 11.
# BEGIN failed--compilation aborted at t/parse_s.t line 11.
Undefined subroutine &Text::BibTeX::Entry::_parse_s called at <path>/blib/lib/Text/BibTeX/Entry.pm line 350.
Unknown Text::BibTeX function: "cleanup" at <path>/blib/lib/Text/BibTeX/Entry.pm line 350.
END failed--call queue aborted at t/parse_s.t line 350.
# Looks like your test exited with 22 just after 2.
t/parse_s.t ..... Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 45/46 subtests 
t/purify.t ...... Warning: Use of "defined" without parentheses is ambiguous at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Use of ?PATTERN? without explicit operator is deprecated at <path>/blib/lib/Text/BibTeX/Entry.pm line 509.
Array found where operator expected at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? "
  (Might be a runaway multi-line ?? string starting on line 509)
    (Do you need to predeclare return?)
t/purify.t ...... 1/110 
#   Failed test 'use Text::BibTeX;'
#   at t/purify.t line 11.
#     Tried to use 'Text::BibTeX'.
#     Error:  syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 511, near "return (@x > 1) ? @x "
# syntax error at <path>/blib/lib/Text/BibTeX/Entry.pm line 514, near "sub value "
# Missing right curly or square bracket at <path>/blib/lib/Text/BibTeX/Entry.pm line 1035, at end of line
# Compilation failed in require at <path>/blib/lib/Text/BibTeX.pm line 253.
# Compilation failed in require at t/purify.t line 11.
# BEGIN failed--compilation aborted at t/purify.t line 11.
Undefined subroutine &main::purify_string called at t/purify.t line 32.
Unknown Text::BibTeX function: "cleanup" at t/purify.t line 32.
END failed--call queue aborted at t/purify.t line 32.
# Looks like your test exited with 22 just after 1.
t/purify.t ...... Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 110/110 subtests 

Test Summary Report
-------------------
t/bib.t       (Wstat: 5632 Tests: 2 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 22
  Parse errors: Bad plan.  You planned 42 tests but ran 2.
t/from_file.t (Wstat: 5632 Tests: 0 Failed: 0)
  Non-zero exit status: 22
  Parse errors: Bad plan.  You planned 5 tests but ran 0.
t/macro.t     (Wstat: 5632 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 22
  Parse errors: Bad plan.  You planned 57 tests but ran 1.
t/modify.t    (Wstat: 5632 Tests: 2 Failed: 1)
  Failed test:  1
  Non-zero exit status: 22
  Parse errors: Bad plan.  You planned 29 tests but ran 2.
t/nameformat.t (Wstat: 5632 Tests: 0 Failed: 0)
  Non-zero exit status: 22
  Parse errors: Bad plan.  You planned 26 tests but ran 0.
t/namelist.t  (Wstat: 5632 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 22
  Parse errors: Bad plan.  You planned 12 tests but ran 1.
t/names.t     (Wstat: 5632 Tests: 0 Failed: 0)
  Non-zero exit status: 22
  Parse errors: Bad plan.  You planned 61 tests but ran 0.
t/output.t    (Wstat: 5632 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 22
  Parse errors: Bad plan.  You planned 20 tests but ran 1.
t/parse.t     (Wstat: 5632 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 22
  Parse errors: Bad plan.  You planned 32 tests but ran 1.
t/parse_f.t   (Wstat: 5632 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 22
  Parse errors: Bad plan.  You planned 73 tests but ran 1.
t/parse_s.t   (Wstat: 5632 Tests: 2 Failed: 1)
  Failed test:  1
  Non-zero exit status: 22
  Parse errors: Bad plan.  You planned 46 tests but ran 2.
t/purify.t    (Wstat: 5632 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 22
  Parse errors: Bad plan.  You planned 110 tests but ran 1.
Files=12, Tests=12,  1 wallclock secs ( 0.05 usr  0.03 sys +  0.77 cusr  0.15 csys =  1.00 CPU)
Result: FAIL
Failed 12/12 test programs. 10/12 subtests failed.
% 

System info:

This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level

Add option to silent warnings

Some warnings from the C library are relevant. Some others, might not.
the warning: overriding existing definition of macro x might be useful on situations, but some others, is just annoying.

An option to be more or less verbose would be nice.

Build starting failing "s390" architecture

Hi, in Fedora GNU/Linux, we've started seeing test failures, I think after moving to Perl 5.24. Unfortunately they only seem to happen on "s390" architecture which I don't have access to---I'm not even sure what it is ;-)

Do the following failures mean anything to you? Basically, instead of getting "J." we get ", J.".

t/bib.t ......... ok
t/from_file.t ... ok
t/macro.t ....... ok
t/modify.t ...... ok
#   Failed test 'first name is abbreviated correctly [1]'
#   at t/nameformat.t line 40.
#          got: ', J.'
#     expected: 'J.'
#   Failed test 'first name is abbreviated correctly [2]'
#   at t/nameformat.t line 44.
#          got: ', J.'
#     expected: 'J.'
#   Failed test 'accented first letter'
#   at t/nameformat.t line 65.
#          got: ', {\'E}.'
#     expected: '{\'E}.'
#   Failed test 'raw test 1'
#   at t/nameformat.t line 104.
Wide character in print at /usr/share/perl5/vendor_perl/Test2/Formatter/TAP.pm line 105.
#          got: ', Š.'
#     expected: 'Š.'
#   Failed test 'raw test 2'
#   at t/nameformat.t line 107.
Wide character in print at /usr/share/perl5/vendor_perl/Test2/Formatter/TAP.pm line 105.
#          got: ', Š.-Š.'
#     expected: 'Š.-Š.'
#   Failed test 'utf-8 [1]'
#   at t/nameformat.t line 111.
Wide character in print at /usr/share/perl5/vendor_perl/Test2/Formatter/TAP.pm line 105.
#          got: ', Š.'
#     expected: 'Š.'
#   Failed test 'utf-8 [2]'
#   at t/nameformat.t line 116.
Wide character in print at /usr/share/perl5/vendor_perl/Test2/Formatter/TAP.pm line 105.
#          got: ', Ż.'
#     expected: 'Ż.'
#   Failed test 'utf-8 [3]'
#   at t/nameformat.t line 121.
Wide character in print at /usr/share/perl5/vendor_perl/Test2/Formatter/TAP.pm line 105.
#          got: ', Z̃.'
#     expected: 'Z̃.'
#   Failed test 'utf-8 [3]'
#   at t/nameformat.t line 126.
Wide character in print at /usr/share/perl5/vendor_perl/Test2/Formatter/TAP.pm line 105.
#          got: ', A̧̦̓.'
#     expected: 'A̧̦̓.'
# Looks like you failed 9 tests of 26.
t/nameformat.t .. 
Dubious, test returned 9 (wstat 2304, 0x900)
Failed 9/26 subtests 
substring 2, warning: empty substring
t/namelist.t .... ok
t/names.t ....... ok
t/output.t ...... ok
t/parse.t ....... ok
t/parse_f.t ..... ok
t/parse_s.t ..... ok
t/purify.t ...... ok
Test Summary Report
-------------------
t/nameformat.t (Wstat: 2304 Tests: 26 Failed: 9)
  Failed tests:  4-5, 7, 11-16
  Non-zero exit status: 9

Downstream bug report with complete logs etc: https://bugzilla.redhat.com/show_bug.cgi?id=1400921

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.