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 };
if (defined $app) {
$_app = $app;
- eval "use $_app;";
+ $_app->use;
if( $@ ) {
$log->error( "Error loading application_implementation: $app -> $@", ERROR);
}
my $class = "OpenSRF::DOM::Element::$tag";
unless (exists $_loaded_classes{$class}) {
- eval "use $class;";
+ $class->use;
$_loaded_classes{$class} = 1;
}
if ($@) {
package OpenSRF::System;
use strict; use warnings;
+use OpenSRF;
use base 'OpenSRF';
use OpenSRF::Utils::Logger qw(:level);
use OpenSRF::Transport::Listener;
_log( " * Server type: $server_type", INTERNAL );
- eval "use $server_type";
+ $server_type->use;
if( $@ ) {
throw OpenSRF::EX::PANIC ("Cannot set $server_type: $@" );
my( $class, $envelope ) = @_;
if( $envelope ) {
$message_envelope = $envelope;
- eval "use $envelope;";
+ $envelope->use;
if( $@ ) {
$logger->error(
"Error loading message_envelope: $envelope -> $@", ERROR);
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 );
sub set_peer_client {
my( $class, $peer ) = @_;
if( $peer ) {
- eval "use $peer;";
+ $peer->use;
if( $@ ) {
throw OpenSRF::EX::PANIC ( "Unable to set peer client: $@" );
}