Keep it on list -- others have the same question 'trust me'
Lev Lvovsky wrote:
Philip, not sure if this is possible, but what happens if Apache::DBI is loaded in the correct order the first time, but then afterwards loaded again after DBI has been loaded - does the Perl loader make sure this doesn't happen to begin with?
Basically when you do a 'require'
$ perldoc -f require
Otherwise, "require" demands that a library file be included if
it hasn't already been included.  The file is included via the
do-FILE mechanism, which is essentially just a variety of
"eval".  Has semantics similar to the following subroutine:
[routine is in the docs, but snipped here]

It checks %INC first.

$ perldoc -f use
Imports some semantics into the current package from the named
module, generally by aliasing certain subroutine or variable
names into your package.  It is exactly equivalent to

BEGIN { require Module; import Module LIST; }

except that Module must be a bareword.


so if you have loaded it already correctly, you are fine.

The reason this order matters is a DBI internals -- its actually Apache::DBI aware not vice-versa. DBI forwards to Apache-DBI not Apache-DBI intercepts DBI.

# check if user wants a persistent database connection ( Apache +
# mod_perl )
if ($INC{'Apache/DBI.pm'} && $ENV{MOD_PERL}) {
    $DBI::connect_via = "Apache::DBI::connect";
    DBI->trace_msg("DBI connect via $DBI::connect_via in
    $INC{'Apache/DBI.pm'}\n");
}

This happens once at load time since its outside a function -- (first load aka startup.pl)



--
------------------------------------------------------------------------
Philip M. Gollucci ([EMAIL PROTECTED]) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

I never had a dream come true
'Til the day that I found you.
Even though I pretend that I've moved on
You'll always be my baby.
I never found the words to say
You're the one I think about each day
And I know no matter where life takes me to
A part of me will always be...
A part of me will always be with you.

Reply via email to