From: miker Date: Sat, 17 Nov 2007 02:08:27 +0000 (+0000) Subject: replacing eval "use blah" with "blah"->use(); X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f9f9d991a1df41ae9444cb14766d3c747beb9841;p=Evergreen.git replacing eval "use blah" with "blah"->use(); git-svn-id: svn://svn.open-ils.org/ILS/trunk@8079 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/AddedContent.pm b/Open-ILS/src/perlmods/OpenILS/WWW/AddedContent.pm index c56407947d..9ef92f7dd2 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/AddedContent.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/AddedContent.pm @@ -11,6 +11,7 @@ use Apache2::RequestRec (); use Apache2::RequestIO (); use Apache2::RequestUtil; use Data::Dumper; +use UNIVERSAL::require; use OpenSRF::EX qw(:try); use OpenSRF::Utils::Cache; @@ -61,7 +62,7 @@ sub child_init { $logger->debug("Attempting to load Added Content handler: $ac_handler"); - eval "use $ac_handler"; + $ac_handler->use; if($@) { $logger->error("Unable to load Added Content handler [$ac_handler]: $@"); diff --git a/Open-ILS/src/support-scripts/oils_header.pl b/Open-ILS/src/support-scripts/oils_header.pl index 2506fd68e6..24c69a64e7 100755 --- a/Open-ILS/src/support-scripts/oils_header.pl +++ b/Open-ILS/src/support-scripts/oils_header.pl @@ -17,9 +17,11 @@ use OpenILS::Utils::Fieldmapper; use OpenILS::Application::AppUtils; use OpenSRF::Utils::SettingsClient; use OpenSRF::Utils::Logger qw/:logger/; +use UNIVERSAL::require; # Some useful objects +our $cache = "OpenSRF::Utils::Cache"; our $apputils = "OpenILS::Application::AppUtils"; our $memcache; our $user; @@ -107,8 +109,8 @@ sub reset_cstore { # Get a handle for the memcache object #---------------------------------------------------------------- sub osrf_cache { - eval 'use OpenSRF::Utils::Cache;'; - $memcache = OpenSRF::Utils::Cache->new('global') unless $memcache; + $cache->use; + $memcache = $cache->new('global') unless $memcache; return $memcache; } diff --git a/Open-ILS/src/support-scripts/settings-tester.pl b/Open-ILS/src/support-scripts/settings-tester.pl index bb3c60ae43..774f00966f 100755 --- a/Open-ILS/src/support-scripts/settings-tester.pl +++ b/Open-ILS/src/support-scripts/settings-tester.pl @@ -8,7 +8,7 @@ BEGIN { eval "use Error qw/:try/;"; die "Please install Error.pm.\n" if ($@); eval "use UNIVERSAL::require;"; - die "Please install the UNIVERSAL::Require perl module.\n" if ($@); + die "Please install the UNIVERSAL::require perl module.\n" if ($@); eval "use Getopt::Long;"; die "Please install the Getopt::Long perl module.\n" if ($@); eval "use Net::Domain;";