laziness, impatience, and hubris | |
PerlMonks |
Re^4: regex transforms of object attributesby belden (Friar) |
on Jun 19, 2004 at 16:21 UTC ( [id://368184]=note: print w/replies, xml ) | Need Help?? |
This will not break due to changes in $obj's interface
This might
The former uses the interface published by the module author. The latter relies on the internal workings of the object itself, and therefore violates the encapsulation of the object's data. The risk that comes with the latter form (your code is now tied to the current version of Whatever::Module, and that requirement is neither enforced nor documented) just doesn't seem worth the gain of avoiding creating $content.
In Section
Seekers of Perl Wisdom
|
|