Many OO CPAN modules are simplicity themselves to use and modify.
I don't agree. I think many OO modules are hard
to modify - the latter meaning "subclass".
Here's coding problem.
Someone has written a BaseballPlayer class, to
maintain statistics of players. Your task is to subclass
it to create a BaseballPlayer::Pitcher class so
the additional statistics for pitchers can be dealt with.
Where are you going to store your instance data?
If you answer "in the hash returned by the constructor of
the BaseballPlayer class", or "in whatever object the superclass
uses", or "that depends on how the BaseballPlayer class is
implemented", you fail the test. And why do you fail? Because
you are breaking the basic concept of object orientness:
encapsulation. It shouldn't matter how the superclass is
implemented. Unfortunally, Perl doesn't make it easy to use
inheritance. It all works handy-dandy if you can enforce a
certain style, implementation or module usage of the total
inheritance tree, but that isn't usually the case. It wouldn't
be code reuse if you had to write everything yourself, now
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.