Hmm.. Maybe one of us is misunderstanding the other.. I have no problem with modules, I just have a problem with the overuse of OOP in cases where it just adds complexity without any benefit. Consider some module "Object", which has the sole task of performing some_operation on $item, the behavior of which could change, depending on the value of some_variable.
use Object;
my $obj = new Object;
$obj->some_operation($item);
$obj->some_variable($argument);
$obj->some_operation($item);
# versus
use Object;
some_operation($item);
some_operation($item, $argument);
In my opinion, there are many types of modules that, for whatever reason, unnecessarily go with an OO approach, even though the paradigm doesn't quite fit, and we get little benefit out if it. I really don't know how to describe the best way to decide. For me, I just look at my package in both ways. If it "feels" right in an object point of view, if I can see a benefit to creating multiple "instances" of my module in the form of objects and toss those around, I'll build it in OO style. If my resulting implementation is going to be a lot more efficient and simpler in a functional style, I'll go that route. Perhaps it's just personal preference...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.