in reply to Script design: Complexity/generalisation vs. simplicity/specialization (was: Majordomo Utility...)

Looks like nobody wants to touch this one, so here are my random thoughts. I could probably say something about the importance of the virtues of Laziness and Hubris, but a lot of perl people have probably heard that before. Instead, I'm going to mention the idea of Extreme Programming, especially the principle that simplicity is key. Don't try to build the perfect be-all, end-all program. Just makes something that does what you need, right now, and don't worry about anticipating every possible future need. (Of course, you don't want to hardcode your script to rename "foo" to "bar", but make things like that parameters so that you could concievably use the thing again.) In the back of your mind, remember that you might have to change your code around later. Keeping it simple will make it easier to change when the time comes, and make you less reluctant to do it.

Without knowing very much about your script, it's hard to make specific recommendations. Usually, people try to offload as much work to subroutines as possible, keeping the main routine as simple as possible. OTOH, you want to remove as many assumptions as possible from the subroutines so that they'll be useful later. Don't spend all your time twiddling, though. Wait and see where you can improve your program when time tells you what its limitations are.

Renaming a directory is easy. Just rename it. That even works in Windows now.