Shipping a complete project is perhaps one of the best ways that helped me get past the "It has to be perfect" thought. In my case it was doing a few ludum dare competitions and forcing myself to submit whatever I finished after the weekend was over. After a few times of doing that it got a little easier to forgive some of the atrocious code I had written. Coding Horror has a good post on this, http://blog.codinghorror.com/version-1-sucks-but-ship-it-any....
Another thing for me was getting involved in open source projects and maintaining my own. The first project I open sourced was a port so once it was in working condition I made it available for others to use. That lead to other projects that I could finally finish even though they weren't "perfect".
I wish you the best and hope you can find a way to cope with it.