|Perl Monk, Perl Meditation|
Perl library or new module?by LaidBackWebSage (Acolyte)
|on Jun 02, 2004 at 14:14 UTC||Need Help??|
LaidBackWebSage has asked for the
wisdom of the Perl Monks concerning the following question:
I need some clarification...
I have been tasked with job of re-writing the code for a web site. The entire site runs on Apache/mod_perl, and is a mish-mash of code, what I would describe as "stream-of-consciousness" code. :-)
My goal is to reduce everything to a bunch of subroutines and default variables and constants that get called as needed.
My conundrum is: how do I do this?
The boss wants a module, but that does not seem correct to me. Most of the code we are using is already depending on modules, so I would need to include calls to these other modules wthin my module, and that just doesn't seem right.
So I looked at putting all my subroutines into 2 Perl libraries: one for database-related code and another for all other code.
But I am not able to "see" the subroutines or variables that I declare in the Perl Library files.
The test script, as well as the Perl libraries, are using the "use strict" pragma, as well as the taint flag (-T) in the shebang.
I suspect that I will have success if I utilize "Package::Foo" syntax, but I want to avoid that if possible.
Fellow coders, what say you?
Many thanks for your input!