From 819cef2c17be425798d764840df6bf8324b5d0c1 Mon Sep 17 00:00:00 2001 From: Scott Walters Date: Sun, 22 May 2011 15:36:40 -0400 Subject: [PATCH] $SIG{__DIE__} is a can of worms. Why doesn't try { } localize it...? --- lib/WebGUI/Asset/Wobject/Survey.pm | 4 ++-- lib/WebGUI/FormBuilder/Role/HasFields.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Survey.pm b/lib/WebGUI/Asset/Wobject/Survey.pm index b2c7dba6e..691da61dd 100644 --- a/lib/WebGUI/Asset/Wobject/Survey.pm +++ b/lib/WebGUI/Asset/Wobject/Survey.pm @@ -470,7 +470,7 @@ sub graph { my $session = $self->session; - eval { require GraphViz }; + eval { local $SIG{'__DIE__'}; require GraphViz }; if ($@) { return; } @@ -710,7 +710,7 @@ sub www_graph { my $i18n = WebGUI::International->new($session, "Asset_Survey"); - eval { require GraphViz }; + eval { local $SIG{'__DIE__'}; require GraphViz }; if ($@) { return '

' . $i18n->get('survey visualization') . '

Survey Visualization requires the GraphViz module'; } diff --git a/lib/WebGUI/FormBuilder/Role/HasFields.pm b/lib/WebGUI/FormBuilder/Role/HasFields.pm index b37f7bdc7..56069a0c5 100644 --- a/lib/WebGUI/FormBuilder/Role/HasFields.pm +++ b/lib/WebGUI/FormBuilder/Role/HasFields.pm @@ -56,7 +56,7 @@ sub addField { # Load the class # Try to load the WebGUI Field first in case we conveniently overlap with a common name # (like Readonly) - if ( $INC{'WebGUI/Form/'. ucfirst $file} || try { require 'WebGUI/Form/' . ucfirst $file } ) { + if ( $INC{'WebGUI/Form/'. ucfirst $file} || try { local $SIG{'__DIE__'}; require 'WebGUI/Form/' . ucfirst $file } ) { $type = 'WebGUI::Form::' . ucfirst $type; } elsif ( !$INC{$file} && !try { require $file; } ) {