in reply to why "Bless" in OO Perl
An object gives (or at least should give) you a black box routine, with a predictable and stable interface. You should be able to invoke $object->methods on the object (and the blessed reference to a data structure) without having to know the details of what happens inside the black box (class or package). By adding to that an understanding of inheritance, it is possible to use Modules (packages, classes), and to inherit methods from those modules. This is because the constructors (the ->new() methods) of those modules return a "blessed" reference that associates that module's methods (subroutines) with the referenced data structure, giving you direct access to all that code in the use'd module.
Someone around here has a sig file pointing out that 90% of every perl script has already been written. That 90% are the modules (cpan or home grown) upon which you build a specific application.
-- Hugh
|
|---|