Keep It Simple, Stupid | |
PerlMonks |
Re^3: $object->UnrelatedPackage::some_subroutine()by Tanktalus (Canon) |
on Feb 19, 2005 at 05:57 UTC ( [id://432652]=note: print w/replies, xml ) | Need Help?? |
Thank you for dropping it. If you really want to avoid passing in the dbh all the time, you're crying out for an object. Your object would more or less just store the dbh (maybe there's other things, too, that make sense for your package, I don't know, I don't use Oracle). Then it would be called via $obj->my_function(123,456) as the $obj created would be, presumably, blessed into MyPackage. I'm sure someone here could help with the design in more detail. If I were ever to use Oracle, and I happened upon your module, and you were asking people to use this style, I would have serious doubts as to the reliability of the module, and, if I were to use it anyway, I sure as heck would not be using this syntax. It really is, IMO, that bad. Now, if someone were to use it in a complex, multi-package obfu, that would be different. "Can you trace this program without running it through the debugger or the deparser?" Here the goal is unreadable code. But my production code using your module ... that needs to be maintainable, and $dbh->Mypackage::my_function(123, 456) is not it. (Of course, I'm also quite partial to object wrappers around the dbh object ... having put one of those on CPAN myself ;->)
In Section
Meditations
|
|