I need to do something like this.
if ($ver > 2) { require 'Config'; } else { require 'Settings'; }
Config is actually the renamed newer version of Settings and both those modules expose the same constant(a hash named CONFIG, but the values are different). But I need this inside another module definition which uses the constants defined in those modules. $ver is a param to new() method of this module. So, I am not able to put it in a BEGIN block outside the module.
Since I am using a 'require', I get Can't use bare word CONFIG. Can someone help me with this please ?In reply to Dynamically requiring a module by balachandran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |