summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2012-07-25 03:21:10 (GMT)
committerEric Wong <normalperson@yhbt.net>2012-07-27 22:13:27 (GMT)
commit0ed8fdcdfd2bebdc7f172383b864836581c39123 (patch)
treedc02eb422fbc1b675f11a5d0b91097beb28e3c7a
parent4c8e5c55c2a2125bb3b6a06c1cd0d4415fac0016 (diff)
downloadgit-0ed8fdcdfd2bebdc7f172383b864836581c39123.zip
git-0ed8fdcdfd2bebdc7f172383b864836581c39123.tar.gz
git-0ed8fdcdfd2bebdc7f172383b864836581c39123.tar.bz2
Don't lose Error.pm if $@ gets clobbered.
In older Perls, sometimes $@ can become unset between the eval and checking $@. Its safer to check the eval directly. Signed-off-by: Michael G Schwern <schwern@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
-rw-r--r--perl/Makefile.PL3
1 files changed, 1 insertions, 2 deletions
diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index 87e1f62..887fa1b 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -41,8 +41,7 @@ my %pm = (
# We come with our own bundled Error.pm. It's not in the set of default
# Perl modules so install it if it's not available on the system yet.
-eval { require Error };
-if ($@ || $Error::VERSION < 0.15009) {
+if ( !eval { require Error } || $Error::VERSION < 0.15009) {
$pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
}