dragonchild wrote:

I believe you asked about this a few months back. How's the project going?

Did I? Sheesh. Early Alzheimer's, I guess.

I was pulled from that project to work on projects for which we're actually getting paid. We have an impending rewrite of the original project and my mind wanders back to the original problem without seeming to get anywhere. The code is such an absolute mess that finding clean solutions seems to be a problem. You and suaveant have both suggested a nice solution, but I don't know that it's always practical.

Let's say we download a module from the CPAN, or have received from a vendor, that has periodic updates. If I don't want to keep reapplying a patch to those modules, I need another solution. I suppose I could write modules that grabs those globals and exports them into my namespace without necessarily requiring that I change the original code. I'd like to fix these programs one at a time without risking my breaking anything by adding code to all of the shared modules.

If I have about 40 programs, this seems a bit better because I can convert everything one-by-one without worrying about who's working on what. The problem is that all of those 40 or so programs use globals in %main::. It doesn't matter what package these variables are declared in, they're usually, but not always, qualified as being in %main::. For those programs that don't use strict, a given global might be in main, in might be in that module's namespace.

I suppose I'm just looking at this new project with dread and am ranting here. I've been trying to find a quick and easy solution to a mess of code and I need to just knuckle down and start digging in. I have to just face the fact that there is no magic bullet that will kill this beast. No point in continuing this thread :(

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to (Ovid -Rant) Re(2): Using strict with globals by Ovid
in thread Using strict with globals by Ovid

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.