Skip to content

Commit

Permalink
Don't lose Error.pm if $@ gets clobbered.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael G. Schwern authored and Eric Wong committed Jul 27, 2012
1 parent 4c8e5c5 commit 0ed8fdc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions perl/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down

0 comments on commit 0ed8fdc

Please sign in to comment.