in reply to How do I dynamically declare a package name for

eval "use $module"; $@ and die $@; # or warn $@, etc. die seems appropriate here my $vendor = $module->new(); # ...
eval is necessary because use is normally a compile-time directive. You could get a similar effect with require and import; for your purposes, use is probably easier.

$@ is where eval puts its error messages. See perlvar for more details.

hdp.