diff --git a/dist.ini b/dist.ini index 820bb42..155f66b 100644 --- a/dist.ini +++ b/dist.ini @@ -11,7 +11,6 @@ copyright_year = 2012 NextVersion::Semantic.format=%d.%03d [Prereqs / Recommends] -Class::Load::XS = 0 Dancer2 = 0.153000 [Prereqs / TestRecommends] diff --git a/lib/Dancer2/Plugin/Adapter.pm b/lib/Dancer2/Plugin/Adapter.pm index 4cbd2a1..cca2715 100644 --- a/lib/Dancer2/Plugin/Adapter.pm +++ b/lib/Dancer2/Plugin/Adapter.pm @@ -7,7 +7,7 @@ package Dancer2::Plugin::Adapter; # VERSION use Dancer2::Plugin; -use Class::Load qw/try_load_class/; +use Module::Runtime qw/use_module/; my %singletons; my $conf; @@ -58,7 +58,7 @@ register service => sub { my $class = $object_conf->{class} or die "No class specified for Adapter '$name'"; - try_load_class($class) + eval { use_module($class); 1 } or die "Module '$class' could not be loaded"; my $new = $object_conf->{constructor} || 'new';