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>

Michael G. Schwern committed Jul 24, 2012 at 20:21 UTC 0ed8fdcdfd2bebdc7f172383b864836581c39123
1 file changed +1 -2
perl/Makefile.PL
+1 -2
@@ -41,8 +41,7 @@ my %pm = (
41
42 # We come with our own bundled Error.pm. It's not in the set of default
43 # Perl modules so install it if it's not available on the system yet.
44 -eval { require Error };
45 -if ($@ || $Error::VERSION < 0.15009) {
44 +if ( !eval { require Error } || $Error::VERSION < 0.15009) {
45 $pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
46 }
47