In FreeBSD disable floating point exception handlers.
[p5sagit/p5-mst-13.2.git] / lib / Fatal.pm
index a1e5cff..5b832f6 100644 (file)
@@ -1,8 +1,9 @@
 package Fatal;
 
+use 5.005_64;
 use Carp;
 use strict;
-use vars qw( $AUTOLOAD $Debug $VERSION);
+our($AUTOLOAD, $Debug, $VERSION);
 
 $VERSION = 1.02;
 
@@ -111,11 +112,13 @@ EOS
     $code .= write_invocation($core, $call, $name, @protos);
     $code .= "}\n";
     print $code if $Debug;
-    $code = eval($code);
-    die if $@;
-    local($^W) = 0;   # to avoid: Subroutine foo redefined ...
-    no strict 'refs'; # to avoid: Can't use string (...) as a symbol ref ...
-    *{$sub} = $code;
+    {
+      no strict 'refs'; # to avoid: Can't use string (...) as a symbol ref ...
+      $code = eval("package $pkg; use Carp; $code");
+      die if $@;
+      no warnings;   # to avoid: Subroutine foo redefined ...
+      *{$sub} = $code;
+    }
 }
 
 1;