Skip to content

Commit

Permalink
Change Carp::Heavy require to be conditional
Browse files Browse the repository at this point in the history
The ‘Carp::Heavy’ module was incorporated into the ‘Carp’ module in Perl version 5.12. So there is no need to require ‘Carp::Heavy’ in that or subsequent Perl versions.

Based on patch sent in by William Birkett.
  • Loading branch information
infininight committed Dec 27, 2019
1 parent 7390bf7 commit 6768cc2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Support/exception_handler.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ sub realwarn { CORE::warn(@_); }
sub realdie { CORE::die(@_); }

sub longmess {
my ($arg, @rest) = shift;
my ($arg, @rest) = @_;
{
local $@;
# XXX fix require to not clear $@?
# don't use require unless we need to (for Safe compartments)
require Carp::Heavy unless $INC{"Carp/Heavy.pm"};
if ($] < 5.012) {
require Carp::Heavy unless $INC{"Carp/heavy.pm"};
}
}
# Icky backwards compatibility wrapper. :-(
my $call_pack = caller();
Expand Down

0 comments on commit 6768cc2

Please sign in to comment.