git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] Git::I18N: compatibility with perl <5.8.3

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 10, 2012, 12:29 UTC
Message-ID
<1331382575-16936-2-git-send-email-avarab@gmail.com>
In-Reply-To
<1331382575-16936-1-git-send-email-avarab@gmail.com>

Change the Exporter invocation in Git::I18N to be compatible with 5.8.0 to 5.8.2 inclusive. Before Exporter 5.57 (released with 5.8.3) Exporter didn't export the 'import' subroutine.

Reported-by: Tom G. Christensen <tgc@statsbiblioteket.dk>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 perl/Git/I18N.pm |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/perl/Git/I18N.pm b/perl/Git/I18N.pm
index 07597dc..40dd897 100644
--- a/perl/Git/I18N.pm
+++ b/perl/Git/I18N.pm
@@ -2,7 +2,16 @@ package Git::I18N;
 use 5.008;
 use strict;
 use warnings;
-use Exporter 'import';
+BEGIN {
+	require Exporter;
+	if ($] < 5.008003) {
+		*import = \&Exporter::import;
+	} else {
+		# Exporter 5.57 which supports this invocation was
+		# released with perl 5.8.3
+		Exporter->import('import');
+	}
+}
 
 our @EXPORT = qw(__);
 our @EXPORT_OK = @EXPORT;
-- 
1.7.9
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 7 of 11 in “I18N.pm is incompatible with perl < 5.8.3”
  1. Tom G. ChristensenFeb 2, 2012
  2. Ævar Arnfjörð BjarmasonFeb 2, 2012
  3. Tom G. ChristensenFeb 2, 2012
  4. Tom G. ChristensenMar 7, 2012
  5. Ævar Arnfjörð BjarmasonMar 7, 2012
  6. 0/2 Minor fixes for Perl + Git::I18NÆvar Arnfjörð Bjarmason, Mar 10, 2012
  7. 1/2 Git::I18N: compatibility with perl <5.8.3Ævar Arnfjörð Bjarmason, Mar 10, 2012
  8. 2/2 perl/Makefile: install Git::I18N under NO_PERL_MAKEMAKERÆvar Arnfjörð Bjarmason, Mar 10, 2012
  9. Junio C HamanoMar 10, 2012
  10. Ævar Arnfjörð BjarmasonMar 11, 2012
  11. Junio C HamanoMar 16, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.