in reply to Right job for the tool.

When would you use OO Perl?

If the module/library needs to retain state, then OO is the natural way to provide for that.

However...

When would you use OO Perl?

Only if the module/library needs to retain state, and, performance is not a consideration for that module/library.

If performance is a consideration, and the functional requirements are such that moving (the critical parts) to C or C++ would be laborious relative to a native Perl implementation; then I will eschew OO and go with a procedural design, manually passing a 'handle' (aka: a dynamically allocated memory address), returned by the 'initialisation' function, to subsequent calls to allow internal state to be retained .

In all coding, in all languages, the functional requirements should drive the design semantics; not the other way around.

OO for its own sake is as destructive as any other dogma.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.