Skip to content

Commit 6768cc2

Browse files
committed
Change Carp::Heavy require to be conditional
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.
1 parent 7390bf7 commit 6768cc2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Support/exception_handler.pm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ sub realwarn { CORE::warn(@_); }
2222
sub realdie { CORE::die(@_); }
2323

2424
sub longmess {
25-
my ($arg, @rest) = shift;
25+
my ($arg, @rest) = @_;
2626
{
2727
local $@;
2828
# XXX fix require to not clear $@?
2929
# don't use require unless we need to (for Safe compartments)
30-
require Carp::Heavy unless $INC{"Carp/Heavy.pm"};
30+
if ($] < 5.012) {
31+
require Carp::Heavy unless $INC{"Carp/heavy.pm"};
32+
}
3133
}
3234
# Icky backwards compatibility wrapper. :-(
3335
my $call_pack = caller();

0 commit comments

Comments
 (0)