Consider I have two modules mod1.pm & mod2.pm. Based on a condition i would like use a module say,
#main script if($module) { use mod1; } else { use mod2; } test(); #mod1.pm sub test { print "Test"; } #mod2.pm sub test { print "Test1"; }
Even when the $module is true, it still invokes the "sub test" in mod2.pm:( Am I doing something wrong or this approach is not possible?
In reply to Need help in dynamically loading a module by Sri Harsha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |