From eacbe84f2391ddbd5ec175a44616859bb07cb25f Mon Sep 17 00:00:00 2001 From: miker Date: Mon, 30 Jan 2006 15:49:53 +0000 Subject: [PATCH] moving to UNIVERSAL::require to suck in implementation modules git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@634 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/OpenSRF.pm | 1 + src/perlmods/OpenSRF/Application.pm | 2 +- src/perlmods/OpenSRF/DOM.pm | 2 +- src/perlmods/OpenSRF/System.pm | 3 ++- src/perlmods/OpenSRF/Transport.pm | 2 +- src/perlmods/OpenSRF/Transport/Listener.pm | 2 +- src/perlmods/OpenSRF/Transport/PeerHandle.pm | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/perlmods/OpenSRF.pm b/src/perlmods/OpenSRF.pm index e6fa333..865f997 100644 --- a/src/perlmods/OpenSRF.pm +++ b/src/perlmods/OpenSRF.pm @@ -1,6 +1,7 @@ package OpenSRF; use strict; use Error; +require UNIVERSAL::require; use vars qw/$VERSION $AUTOLOAD/; $VERSION = do { my @r=(q$Revision$=~/\d+/g); sprintf "%d."."%02d"x$#r,@r }; diff --git a/src/perlmods/OpenSRF/Application.pm b/src/perlmods/OpenSRF/Application.pm index d55c9ac..0e2a1cd 100644 --- a/src/perlmods/OpenSRF/Application.pm +++ b/src/perlmods/OpenSRF/Application.pm @@ -73,7 +73,7 @@ sub application_implementation { if (defined $app) { $_app = $app; - eval "use $_app;"; + $_app->use; if( $@ ) { $log->error( "Error loading application_implementation: $app -> $@", ERROR); } diff --git a/src/perlmods/OpenSRF/DOM.pm b/src/perlmods/OpenSRF/DOM.pm index 7e23d9c..8ddb095 100644 --- a/src/perlmods/OpenSRF/DOM.pm +++ b/src/perlmods/OpenSRF/DOM.pm @@ -74,7 +74,7 @@ sub upcast { my $class = "OpenSRF::DOM::Element::$tag"; unless (exists $_loaded_classes{$class}) { - eval "use $class;"; + $class->use; $_loaded_classes{$class} = 1; } if ($@) { diff --git a/src/perlmods/OpenSRF/System.pm b/src/perlmods/OpenSRF/System.pm index 54f8ad6..86d340c 100644 --- a/src/perlmods/OpenSRF/System.pm +++ b/src/perlmods/OpenSRF/System.pm @@ -1,5 +1,6 @@ package OpenSRF::System; use strict; use warnings; +use OpenSRF; use base 'OpenSRF'; use OpenSRF::Utils::Logger qw(:level); use OpenSRF::Transport::Listener; @@ -192,7 +193,7 @@ sub bootstrap { _log( " * Server type: $server_type", INTERNAL ); - eval "use $server_type"; + $server_type->use; if( $@ ) { throw OpenSRF::EX::PANIC ("Cannot set $server_type: $@" ); diff --git a/src/perlmods/OpenSRF/Transport.pm b/src/perlmods/OpenSRF/Transport.pm index ffbe3b9..d30db4e 100644 --- a/src/perlmods/OpenSRF/Transport.pm +++ b/src/perlmods/OpenSRF/Transport.pm @@ -56,7 +56,7 @@ sub message_envelope { my( $class, $envelope ) = @_; if( $envelope ) { $message_envelope = $envelope; - eval "use $envelope;"; + $envelope->use; if( $@ ) { $logger->error( "Error loading message_envelope: $envelope -> $@", ERROR); diff --git a/src/perlmods/OpenSRF/Transport/Listener.pm b/src/perlmods/OpenSRF/Transport/Listener.pm index 34e54a4..c3496b1 100644 --- a/src/perlmods/OpenSRF/Transport/Listener.pm +++ b/src/perlmods/OpenSRF/Transport/Listener.pm @@ -32,7 +32,7 @@ sub set_listener { my( $class, $listener ) = @_; OpenSRF::Utils::Logger->transport("Loading Listener $listener", INFO ); if( $listener ) { - eval "use $listener;"; + $listener->use; if( $@ ) { OpenSRF::Utils::Logger->error( "Unable to set transport listener: $@", ERROR ); diff --git a/src/perlmods/OpenSRF/Transport/PeerHandle.pm b/src/perlmods/OpenSRF/Transport/PeerHandle.pm index b0dc123..e263971 100644 --- a/src/perlmods/OpenSRF/Transport/PeerHandle.pm +++ b/src/perlmods/OpenSRF/Transport/PeerHandle.pm @@ -29,7 +29,7 @@ classes capabilities. sub set_peer_client { my( $class, $peer ) = @_; if( $peer ) { - eval "use $peer;"; + $peer->use; if( $@ ) { throw OpenSRF::EX::PANIC ( "Unable to set peer client: $@" ); } -- 2.11.0