go ahead... be a heretic | |
PerlMonks |
Require all modules in lib ?by ZlR (Chaplain) |
on Jun 07, 2005 at 10:10 UTC ( [id://464206]=perlquestion: print w/replies, xml ) | Need Help?? |
ZlR has asked for the wisdom of the Perl Monks concerning the following question:
Esteemed Monks of the Monastery,
I'm sure it's a classic problem . Suppose i have a lib directory : c:\tmp\test\testlib holding two modules : mod1.pm and mod2.pm . These module are in a package called Test and each one defines a function "test1" and "test2" . These two modules are required in another file, testlib.pm, residing in the same directory This testlib.pm is in turn used by a script run.pl that is in c:\tmp\test\script\ : In testlib.pm, if i do : ... Everything works fine .
But this implies that i add every new module manualy, so i tried to dynamically require the module files. I do this in testlib.pm instead of the two requires. I tried many variations like keeping the .pm or using instead or requiring or specifying full path in the require instead of the :: style, everything fails . Can anyone explain what's hapenning ?
Back to
Seekers of Perl Wisdom
|
|