Can someone please explain why the first time I load 'Value' in ExtraModule 'getValue' gets called without problems while the second time in MainModule, it fails... and how I can do this if I need to call getValue in both MainModule & ExtraModule??? thanks a bunch, Michael#Value.pm (no package declaration) sub getValue { ... } 1; #MainModule.pm package MainModule { use ExtraModule; ExtraModule::doSomething(); require Value; $x = 'getValue'; &$x(); #does not work at all } #ExtraModule.pm package ExtraModule { sub doSomething() { require Value; $x = 'getValue'; &$x(); #works fine } }
In reply to requiring pm modules by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |