in reply to Re: Splitting program into modules
in thread Splitting program into modules

Object Oriented Programming: logical modules are sometimes better OO classes ...

As for whether and when to use OO, my simple rule of thumb is to ask "do I need more than one?": if the answer is yes, an object is indicated; if the answer is no, a module.

A (non Perl-specific) design checklist (derived from On Coding Standards and Code Reviews):

Replies are listed 'Best First'.
Re^3: Splitting program into modules
by LanX (Saint) on Nov 12, 2018 at 10:58 UTC
    I once had to maintain code which had many subs accessing a bunch of global states which where switched by calling an "init()" routine or passed flags.

    After long analysis (Freudian yes) I realized that these routines where effectively methods, the states where instance vars and the so called init() routine switched the instances.

    Well actually that was only a simplified description of what happened, I don't wanna give you nightmares. :)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

    </div