tomazos has asked for the wisdom of the Perl Monks concerning the following question:

I've just used perl -MCPAN -e shell to install DBI. Everything looked OK.

I then try to run this code:

use strict; use warnings; use DBI; use Data::Dumper; my @drivers = DBI->available_drivers(); print Dumper(@drivers); foreach my $driver (@drivers) { print "Driver: $driver\n"; my @data_ +sources = DBI->data_sources($driver); foreach my $data_source (@data_sources) { print "\tData Source is $data_source\n"; } print "\n"; }

Which breaks as follows:

$VAR1 = 'ADO'; $VAR2 = 'ExampleP'; $VAR3 = 'Multiplex'; $VAR4 = 'Proxy'; $VAR5 = 'mysql'; Driver: ADO install_driver(ADO) failed: Can't locate Win32/OLE/Variant.pm in @INC +(@INC contains: /usr/lib/perl5/i386-linux /usr/lib/perl5 /usr/lib/per +l5/site_perl/i386-linux /usr/lib/perl5/site_perl /usr/lib/perl5/site_ +perl .) at /usr/lib/perl5/site_perl/i386-linux/DBD/ADO.pm line 558. BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/i386-lin +ux/DBD/ADO.pm line 558. Compilation failed in require at (eval 1) line 3. Perhaps a module that DBD::ADO requires hasn't been fully installed at test7.pl line 12

Any ideas?

Replies are listed 'Best First'.
Re: DBI Installation Problem
by runrig (Abbot) on Aug 08, 2001 at 03:24 UTC
    Seems pretty self-explanatory to me. DBI is installed ok, but a pre-requisite for DBD::ADO is not installed. You could eval the call to data_source and trap the perfectly valid error. But a better question is: why are you looking for ADO datasources on a linux box?