RE: DBI->installed_drivers() usage

RE: DBI->installed_drivers() usage

am 20.07.2006 00:20:41 von pgriffin

Tim,

Many thanks.

Regards Paul...

-----Original Message-----
From: Tim Bunce [mailto:Tim.Bunce@pobox.com]
Sent: Thursday, July 20, 2006 1:37 AM
To: Garrett, Philip (MAN-Corporate)
Cc: Paul Griffin; dbi-users@perl.org
Subject: Re: DBI->installed_drivers() usage

On Wed, Jul 19, 2006 at 09:24:53AM -0400, Garrett, Philip (MAN-Corporate)
wrote:
> Paul Griffin wrote:
> > I'm running Win XP with Perl 5.8.8.
> >
> > If I try and run the following code :
> >
> > use DBI;
> > my %drivers = DBI->installed_drivers();
> > foreach (keys( %drivers)) {
> > print "$_ uses $drivers{$_}\n";
> > }
> >
> > Nothing is returned. Yet if I use :
> >
> > my @drivers = DBI->available_drivers();
> >
> > I get a list of drivers that I can then access with :
> >
> > @dataSources = DBI->data_sources($_);
> >
> > Am I using DBI->installed_drivers() incorrectly?
>
> DBI->installed_drivers returns only the drivers that are actually loaded
> into the current process. Installed in this case means "installed into
> memory."

Ah. The docs weren't clear:


--- DBI.pm (revision 6618)
+++ DBI.pm (working copy)
@@ -2753,10 +2753,15 @@

%drivers = DBI->installed_drivers();

-Returns a list of driver name and driver handle pairs for all
-installed drivers. The driver name does not include the 'DBD::'
-prefix. Added in DBI 1.49.
+Returns a list of driver name and driver handle pairs for all drivers
+'installed' (loaded) into the current process. The driver name does not
+include the 'DBD::' prefix.

+To get a list of all drivers available in your perl instalation you can use
+L.
+
+Added in DBI 1.49.
+
=item C

DBI->installed_versions;

Tim.