in reply to Lots of subs in large program vs lots of small programs

This sounds like an exercise in refactoring. And as such I agree with tilly and roger that you should not go to the level of breaking your code into modules until you have broken it into a set of subroutines and convertered unnecessary duplication into subroutine calls with differing parameters.

Once you've refactored the code into a set of generalized subs its quite possible that you will notice that they can be further grouped by some reasonable criterion and thus be extracted into an external module for reuse. Avoid trying to refactor the subs to match some preordained module structure, as its easy to end up trying to restructure a square peg into a round hole. Rather use your intuition to break the subs into the appropriate tasks and sizes that seem natural for the code and your own thinking. If this results in something suitable for modularization then so be it, but all too often its unnecessary.


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi