Thanks for the tip. Using 'use' in an 'eval' did the trick with my setup:
$module[10] = "Combo::Standard";
$module[13] = "CTS::Standard";
$module[16] = "Tax_P::Standard";
$module[15] = "Tax_Q::Standard";
#---------------------------------------------------------------------------------------------
sub validate_file()
#---------------------------------------------------------------------------------------------
{
my $obj = undef;
if (defined $module[$fileSpecID]) {
eval "use $module[$fileSpecID]";
die "couldn't load module : $!n" if ($@);
$obj = new Standard;
return $obj->ValidateImportFile();
}
else {
return 0;
}
}
Code:
$module[10] = "Combo::Standard";
$module[13] = "CTS::Standard";
$module[16] = "Tax_P::Standard";
$module[15] = "Tax_Q::Standard";
#---------------------------------------------------------------------------------------------
sub validate_file()
#---------------------------------------------------------------------------------------------
{
my $obj = undef;
if (defined $module[$fileSpecID]) {
eval "use $module[$fileSpecID]";
die "couldn't load module : $!n" if ($@);
$obj = new Standard;
return $obj->ValidateImportFile();
}
else {
return 0;
}
}