I've had the best luck with writing the synopsis first—the stuff that goes near the top of the POD.
Yes, I was going to say something like that. I don't always write tests first (writing them soon is good enough), but writing (some of) the documentation first is almost always helpful. I find it encourages me to simplify the interface: I get rid of unnecessary options because they're too much of a pain to write about.
But it sounds like the OP has not yet gotten in the habit of putting almost all of the code into modules, and that's really the first step toward sanity. For one thing, it makes it a lot easier to write fine-grained unit tests.
<code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>