tosh has asked for the wisdom of the Perl Monks concerning the following question:
Then my PERL program would have the variables and methods contained in CONF-A.pm at least this is what I would like to happen...rather than the compile errors.$dynamic_configuration = 'CONF-A'; use $dynamic_configuration;
I'd rather not have to change all my programs to add CONF-D, E, and F.if ($A) { use CONF-A; } elsif ($B) { use CONF-B; } elsif ($C) { use CONF-C; }
The problem with that is that the CONF.pm file can get very large and I would prefer to keep such a large configuration out of memory and not have such a monster to edit.%conf = (CONF-A => 'foo', etc..., CONF-B => 'bar', etc..., CONF-C => 'baz', etc...);
But the ????? part trips me up.$x = 'A'; eval "require CONF-$x"; import ????? qw(var1 var2...);
|
|---|