Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Re^2: $object->UnrelatedPackage::some_subroutine()
in thread $object->UnrelatedPackage::some_subroutine()

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 ;->)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://432652]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-03-19 07:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found