]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Meta/TypeConstraint/Autocoerce.pm
Localize the die handler when requiring for autocoercion
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Meta / TypeConstraint / Autocoerce.pm
index 9c65f364c181cbcd19bfdbeed1e4802ef2e74f49..165794c8740db2604c54c43967792440b4df560d 100644 (file)
@@ -121,7 +121,14 @@ sub load {
  return 0 if $INC{$pm}; # already loaded
 
  local $@;
- eval { require $pm; 1 };
+ eval {
+  # We die often here, even though we're not really interested in the error.
+  # However, if a die handler is set (e.g. to \&Carp::confess), this can get
+  # very slow. Resetting the handler shows a 10% total time improvement for the
+  # geodyn app.
+  local $SIG{__DIE__};
+  require $pm;
+ };
 
  return 0;
 }