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!


In reply to Perl library or new module? by LaidBackWebSage

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.