This will be painful, but I think the best start will be to write documentation and tests. That should expose whatever unities may have survived what sounds like a normally haphazard development.

You probably have three major independent chunks. The GUI/event mechanism is probably easy to encapsulate, since it depends on Tk and has a clear interface in the event handlers and dialogs (or whatever). The second and perhaps third chunk is the control mechanism in the "batch file" generating and parsing. The other third is the interfaces to external tools you call.

That leaves out utility modules that you will probably need. You say there are lots of global variables. Trying to limit those to smaller scopes will go a long way towards exposing closely related code. Those that are truly global become part of your configuration module.

I hope you're granted time to do this right. Have fun!

After Compline,
Zaxo


In reply to Re: reworking a large program by Zaxo
in thread reworking a large program by gri6507

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.