Lines 18-23
use Pod::Usage;
Link Here
|
18 |
use Data::Dumper; |
18 |
use Data::Dumper; |
19 |
use Time::HiRes qw/time/; |
19 |
use Time::HiRes qw/time/; |
20 |
use POSIX qw/strftime ceil/; |
20 |
use POSIX qw/strftime ceil/; |
|
|
21 |
use Module::Load::Conditional qw(can_load); |
21 |
|
22 |
|
22 |
sub usage { |
23 |
sub usage { |
23 |
pod2usage( -verbose => 2 ); |
24 |
pod2usage( -verbose => 2 ); |
Lines 53-65
if ( not $result or $want_help ) {
Link Here
|
53 |
|
54 |
|
54 |
my $linker_module = |
55 |
my $linker_module = |
55 |
"C4::Linker::" . ( C4::Context->preference("LinkerModule") || 'Default' ); |
56 |
"C4::Linker::" . ( C4::Context->preference("LinkerModule") || 'Default' ); |
56 |
eval { eval "require $linker_module"; }; |
57 |
unless ( can_load( modules => { $linker_module => undef } ) ) { |
57 |
if ($@) { |
|
|
58 |
$linker_module = 'C4::Linker::Default'; |
58 |
$linker_module = 'C4::Linker::Default'; |
59 |
eval "require $linker_module"; |
59 |
unless ( can_load( modules => { $linker_module => undef } ) ) { |
60 |
} |
60 |
die "Unable to load linker module. Aborting."; |
61 |
if ($@) { |
61 |
} |
62 |
die "Unable to load linker module. Aborting."; |
|
|
63 |
} |
62 |
} |
64 |
|
63 |
|
65 |
my $linker = $linker_module->new( |
64 |
my $linker = $linker_module->new( |
66 |
- |
|
|