summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Exporter/Heavy.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Exporter/Heavy.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/Exporter/Heavy.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl/lib/Exporter/Heavy.pm b/Master/tlpkg/tlperl/lib/Exporter/Heavy.pm
index 724028a2b1a..21b67c18c46 100644
--- a/Master/tlpkg/tlperl/lib/Exporter/Heavy.pm
+++ b/Master/tlpkg/tlperl/lib/Exporter/Heavy.pm
@@ -38,8 +38,13 @@ sub _rebuild_cache {
sub heavy_export {
+ # Save the old __WARN__ handler in case it was defined
+ my $oldwarn = $SIG{__WARN__};
+
# First make import warnings look like they're coming from the "use".
local $SIG{__WARN__} = sub {
+ # restore it back so proper stacking occurs
+ local $SIG{__WARN__} = $oldwarn;
my $text = shift;
if ($text =~ s/ at \S*Exporter\S*.pm line \d+.*\n//) {
require Carp;