[EMAIL PROTECTED] wrote:
You are in fact using the DBI module. The DB handle is probably (I think it is) a bless reference that will send you straight to the DBI module that's called in the function you've created. Although you're not using the DBI module in your code, you're indirectly using it without ever knowing it if you made a good enough class.

I think. I hope. Maybe I'm completely wrong. I don't know. Someone will correct me though. Right or Wrong.

Will


Generally you are correct, though there is a little "and then in step 3 black magic happens and..." to your answer.


Presumably the 'use DBI' is still in the top of the personal module. It must be somewhere (obviously), and that is generally where it would go. In this case the module is accessing the DBI functions, so 'use DBI' goes at the top of the module, then the script is accessing the MyModule functions, so 'use MyModule' goes at the top of the script... but, Perl has only one @INC/%INC, so once a library is loaded... it is loaded. This allows you to get away with a few coding problems, specifically you may load and access a library in one module, then load a second that accesses the library's code, but can only do so because the other module had loaded it, so if you removed the 'use' for that module the code would break. (I just found one of these in my own code while unit testing...)

OP, Have you read:

perldoc perlmod
perldoc perlmodlib
perldoc perlmodstyle
perldoc -f use
perldoc -f package

And you may want to consider the Learning Perl Objects, References, and Modules from O'Reilly...

http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to