in reply to Re: Can we have C-style Modularity?
in thread Can we have C-style Modularity?

Thanks for your reply.

Agreed, that it's a Perl module and just do it. However, therein lies my question:

Should a Perl Module only aim at re-usability across different scripts,
OR
Can it simply be used for the sake of 'Modularity' of 1 script, even if it might not be used by other scripts?

Thank you!

Replies are listed 'Best First'.
Re^3: Can we have C-style Modularity?
by bellaire (Hermit) on Jan 19, 2011 at 15:13 UTC
    Either. There is more than one way to organize code. You are free to use modules in whatever manner makes the most sense for the organization of your own code.
Re^3: Can we have C-style Modularity?
by ikegami (Patriarch) on Jan 19, 2011 at 17:11 UTC

    Should a Perl Module only aim at re-usability across different scripts,

    If you mean "Should a module only be written when it'll only be used by many scripts?", then the answer is no. Feel free to write modules that will only be used by one script.

    The way you phrased possibly indicates an intention to tightly couple the modules, and that's bad practice in any language.

Re^3: Can we have C-style Modularity?
by Anonyrnous Monk (Hermit) on Jan 19, 2011 at 15:13 UTC

    I don't see any problem using it only for the sake of modularity of one script :)