For example, I have three arrays that each have to be spliced whenever one of them is, but that's not obvious when working on a routine that deals with only one of them

Use objects. Really. Your problem is that you are doing something complex and scurrying around doing all the things a good object system should be making simple manually all over the place. And as you have discovered, as a system grows large, it becomes impossible to keep all the details in your head at one time.

Step back from your code and analyze what it does. Massive use of global variables is usually a symptom of lack of analysis - you didn't know what you were going to do before you did it. In the hundreds of packages totaling megabytes of Perl code I've written in the last few years, there are only a few _dozen_ global variables - nearly all of which are in fact constants.

If you have three things that have to be maintained in complete synchronization - embed them in a 'container' object that understands how to update and read them. Talk to the container object - never directly to the hashes. Then updates only take one simple call and you worry about what not how the container does what it does in the rest of your code.


In reply to Re: Re: Perl editor idea by snowhare
in thread Perl editor idea by Wassercrats

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.