Without knowing anything about the code in the one application/three products, it will be hard to give you specific advice.
In past projects I've used a combination approach that attempts to balance the positives and negatives of refactoring and rewriting. In your case, I might suggest designing the architecture how you want it to be and then start to rewrite it, but take as many snippets as possible from the current code and refactor them as needed when you plug them into the new design (the latter might be aided by doing some minor refactoring of the existing code first - breaking out code into subroutines, adding blocks to tighten the scope of variables, etc). That would give you the new design that you need, but it would leverage some of the functionality and strengths of the existing code so you don't have to rewrite the whole thing from scratch (provided there are pieces that are good enough to salvage).
Regardless of the approach you take, the Perl Medic will likely help. In addition, a few recent threads may be of interest, including Strategies for maintenance of horrible code?, Consideration for others code, and Perl in the Enterprise (the latter mentions Devel::Refactor and the PPI refactoring editor).
Update: ++ to GrandFather for the comments about adding a test suite. I thought of it, then forgot to include it (that's what I get for posting while tired). Read his node - he said it better than I would have, anyway. :-)
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||