# text and function arguments should be formatted when printed.
$CarpInternal{Carp}++;
+$CarpInternal{warnings}++;
$CarpLevel = 0; # How many extra package levels to skip on carp.
# How many calls to skip on confess.
# Reconciling these notions is hard, use
sub longmess {
{ local $@; require Carp::Heavy; } # XXX fix require to not clear $@?
- goto &longmess_heavy;
+ # Icky backwards compatibility wrapper. :-(
+ my $call_pack = caller();
+ if ($Internal{$call_pack} or $CarpInternal{$call_pack}) {
+ return longmess_heavy(@_);
+ }
+ else {
+ local $CarpLevel = $CarpLevel + 1;
+ return longmess_heavy(@_);
+ }
}
sub shortmess { # Short-circuit &longmess if called via multiple packages
{ local $@; require Carp::Heavy; } # XXX fix require to not clear $@?
- goto &shortmess_heavy;
+ # Icky backwards compatibility wrapper. :-(
+ my $call_pack = caller();
+ local @CARP_NOT = caller();
+ shortmess_heavy(@_);
}