replacing eval "use blah" with "blah"->use();
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 17 Nov 2007 02:07:32 +0000 (02:07 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 17 Nov 2007 02:07:32 +0000 (02:07 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@8078 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/WWW/AddedContent.pm
Open-ILS/src/support-scripts/oils_header.pl
Open-ILS/src/support-scripts/settings-tester.pl

index c564079..9ef92f7 100644 (file)
@@ -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]: $@"); 
index 2506fd6..6d3ce4e 100755 (executable)
@@ -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;
 }
 
index bb3c60a..774f009 100755 (executable)
@@ -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;";