Wiggins d'Anconia wrote:
[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.

Yes, I have 'use DBI', well actually 'use Apache::DBI', in MyModule. So, if I were to try to create the database handle in my script instead of MyModule, it would fail since my script knows nothing of the DBI module.


OP, Have you read:

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

No, but I will.


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

I will look into it. I've already read Learning Perl and I own Perl Cookbook, Advanced Perl Programming, and the Perl Pocket Reference, which is very nifty and actually fits in my pocket! :)


--
Andrew Gaffney
Network Administrator
Skyline Aeronautics, LLC.
636-357-1548


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