Gossamer Forum
Home : General : Perl Programming :

Re: [mkp] Conditional inline use of use

Quote Reply
Re: [mkp] Conditional inline use of use In reply to
Thanks for the tip. Using 'use' in an 'eval' did the trick with my setup:

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;
}
}
Subject Author Views Date
Thread Conditional inline use of use rgbworld 9470 Sep 4, 2006, 11:52 AM
Post Re: [rgbworld] Conditional inline use of use
fuzzy logic 9266 Sep 4, 2006, 5:51 PM
Thread Re: [rgbworld] Conditional inline use of use
mkp 9279 Sep 7, 2006, 10:10 AM
Post Re: [mkp] Conditional inline use of use
pgwalters 9074 Jan 4, 2007, 1:47 PM