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

DBI users,

(I tried emailing this to "dbi-users@perl.org", but it bounced.)

I'm running a command that (eventually) calls a Perl script, at the end I get the following error messages:

DBD::CSV initialisation failed: Can't locate auto/DBI/setup_drive.al i +n @INC (@INC contains: /usr/local/projects/aps/MSC_R-14-1_K/lib/cmtool/module +/earl/bin/../pm /pkg/perl/5.8.6/lib/5.8.6/sun4-solaris /pkg/perl/5.8. +6/lib/5.8.6 /pkg/perl/5.8.6/lib/site_perl/5.8.6/sun4-solaris /pkg/per +l/5.8.6/lib/site_perl/5.8.6 /pkg/perl/5.8.6/lib/site_perl .) at /pkg/perl/5.8.6/lib/site_perl/5.8.6/sun4-solaris/DBD/File.pm line 4 +8 at /usr/local/projects/aps/MSC_R-14-1_K/lib/cmtool/module/earl/bin/Pr +eopCheckout.plx line 62

I have another version of this environment that uses a different Perl area, and this works, but I can't find a "setup_drive.al" file anywhere in either the working or non-working areas.

Where do I obtain this missing setup_drive.al file? Is there another DBI module I need to install?

Below are the source lines from the error thread:

PreopCheckout.plx, line 62 $DBH = DBI->connect( "DBI:CSV:f_dir=$CC::DB" ) or Ut::l_die( "Can't +connect: $DBI::errstr\n" ); DBD/File.pm, line 48: DBI->setup_driver('DBD::File'); # only needed once but harmless to rep +eat
Thanks in advance,

Randy Applegate

Software Engineer
Ericsson Inc.

Replies are listed 'Best First'.
Re: Where do I obtain file DBI/setup_drive.al?
by moritz (Cardinal) on Oct 15, 2009 at 21:38 UTC

    .al files are usually missing when a perl module isn't correctly installed, for example when XS modules are not built and installed, but just the .pm files are copied.

    So, how did you install DBI and DBD::CSV? In case of doubt let CPAN.pm do the work, it also runs the tests and verifies that the modules work before they are installed.

    And by the way your message did make it to the DBI users lists.

    Perl 6 - links to (nearly) everything that is Perl 6.
      .al files are usually missing when a perl module isn't correctly installed

      Actually, in my experience, it is much, much more likely that the reason that a *.al file is "missing" is because the module in question doesn't actually have (in this case) a setup_drive(r) method.

      Searching for when DBI may have acquired a /^setup_drive/ method, I only found:

      Changes in DBI 1.35, 7th March 2003
       * Added note to install_method docs about setup_driver() method.

      Looking at DBI.pm, I see that it does not use AutoLoader or such and so there is absolutely no point in having an AUTOLOAD that looks for *.al files when a method in DBI is not found.

      A big part of the problem is this line:

      @ISA = qw(Exporter DynaLoader);

      It was a pretty stupid idea to use inheritance in the design of Exporter and DynaLoader. One or both of those likely similarly use inheritance to make use of AutoLoader. Inheritance in transitive so this all makes DBI also use AutoLoader even though it had no intention of doing so.

      It is a bit of a mystery why DBI's inherited AUTOLOAD can be found but not "sub setup_driver" which is plainly visible in the latest DBI.pm and has been in that module for several years. But the "missing *.al file" is a complete red herring.

      - tye        

      Perl modules are installed by our UNIX admin, using the standard installation sequence:
      perl Makefile.PL make make test make install
      The CSV.pm file is dated Sept 2000. I have filed a ticket to have the latest versions of DBD and DBI installed.

      Thanks.