From 9b86bb5cacfb65a283299b005919058f8a61701a Mon Sep 17 00:00:00 2001 From: Todd Rinaldo Date: Sat, 3 Jul 2010 15:32:08 +0200 Subject: [PATCH] Fix RT #74472 Exporter.pm blocks Signal handling Exporter.pm overrides SIG{__WARN__}. This means It's not possible to write a test to trap warning events for this error. Since all the line seems to do is make the warning more verbose, I suggest it not be done if someone has defined a custom signal. At the moment Test::NoWarnings cannot trap these warnings because of this. --- lib/Exporter.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Exporter.pm b/lib/Exporter.pm index c37f39c..5fcc993 100644 --- a/lib/Exporter.pm +++ b/lib/Exporter.pm @@ -62,7 +62,7 @@ sub import { } return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy; local $SIG{__WARN__} = - sub {require Carp; &Carp::carp}; + sub {require Carp; &Carp::carp} if not $SIG{__WARN__}; # shortcut for the common case of no type character *{"$callpkg\::$_"} = \&{"$pkg\::$_"} foreach @_; } -- 2.7.4