Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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 } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: requiring pm modules
by itub (Priest) on Nov 03, 2004 at 20:55 UTC | |
|
Re: requiring pm modules
by pg (Canon) on Nov 03, 2004 at 20:57 UTC | |
by Anonymous Monk on Nov 03, 2004 at 21:05 UTC | |
by itub (Priest) on Nov 03, 2004 at 21:12 UTC | |
by revdiablo (Prior) on Nov 03, 2004 at 23:08 UTC | |
by Anonymous Monk on Nov 03, 2004 at 21:15 UTC | |
by Anonymous Monk on Nov 03, 2004 at 21:17 UTC | |
by Mutant (Priest) on Nov 03, 2004 at 21:10 UTC | |
by revdiablo (Prior) on Nov 03, 2004 at 23:11 UTC | |
|
Re: requiring pm modules
by Mutant (Priest) on Nov 03, 2004 at 20:48 UTC |