While this may not help your specific situation, what we tend to do is the following:
- If the code contains anything that's client-specific or client-provided, it's closed-source for the client. Period. There is NEVER an exception to this.
- If the code is general-purpose that just happened to be developed as part of work for a client, we opensource it, usually by releasing it to CPAN.
Our clients understand this process and have no problems with it. You might want to work out a similar understanding with your clients.
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?