From: Tom G. Christensen Date: Thu, 02 Feb 2012 13:11:20 GMT Subject: I18N.pm is incompatible with perl < 5.8.3 Message-ID: <4F2A8B78.6090902@statsbiblioteket.dk> Hello, While running the git 1.7.9 testsuite on RHEL 3 with perl 5.8.0 and gettext 0.11.4 I got this error in t0202-gettext-perl.sh: # test_external test Perl Git::I18N API failed: /usr/bin/perl /builddir/build/BUILD/git-1.7.9/t/t0202/test.pl # test_external_without_stderr test no stderr: Perl Git::I18N API failed: /usr/bin/perl /builddir/build/BUILD/git-1.7.9/t/t0202/test.pl: A verbose run gave me this: # test_external test Perl Git::I18N API failed: /usr/bin/perl /builddir/build/BUILD/git-1.7.9/t/t0202/test.pl # expecting no stderr from previous command # test_external_without_stderr test no stderr: Perl Git::I18N API failed: /usr/bin/perl /builddir/build/BUILD/git-1.7.9/t/t0202/test.pl: # Stderr is: "import" is not exported by the Exporter module Can't continue after import errors at /builddir/build/BUILD/git-1.7.9/t/../perl/blib/lib/Git/I18N.pm line 5 BEGIN failed--compilation aborted at /builddir/build/BUILD/git-1.7.9/t/../perl/blib/lib/Git/I18N.pm line 5. Compilation failed in require at /builddir/build/BUILD/git-1.7.9/t/t0202/test.pl line 8. BEGIN failed--compilation aborted at /builddir/build/BUILD/git-1.7.9/t/t0202/test.pl line 8. # Looks like your test died before it could output anything. I found the cause and the solution here: http://www.nntp.perl.org/group/perl.module.build/2008/02/msg1214.html I've changed use Exporter 'import' to BEGIN { require Exporter; *{import} = \&Exporter::import; } in I18N.pm. The test now passes (GETTEXT_LOCALE=1): # lib-gettext: No is_IS UTF-8 locale available # lib-gettext: No is_IS ISO-8859-1 locale available # run 1: Perl Git::I18N API (/usr/bin/perl /builddir/build/BUILD/git-1.7.9/t/t0202/test.pl) 1..8 ok 1 - Testing Git::I18N with NO Perl gettext library ok 2 - Git::I18N is located at /builddir/build/BUILD/git-1.7.9/t/../perl/blib/lib/Git/I18N.pm ok 3 - sanity: Git::I18N has 1 export(s) ok 4 - sanity: Git::I18N exports everything by default ok 5 - sanity: __ has a $ prototype ok 6 - Passing a string through __() in the C locale works ok 7 - Without a gettext library + locale turns into ok 8 - Without a gettext library + locale turns into # test_external test Perl Git::I18N API was ok # expecting no stderr from previous command # test_external_without_stderr test no stderr: Perl Git::I18N API was ok -tgc