in reply to Re: DBI Problem
in thread DBI Problem

please provide an SSCCE to avoid such waste this time around

I tried that with previous problems. When I tried to reduce to a small block of code the problems disappeared so it was not an example. And IIRC I just struggled through until stumbling on solution.

The error message is pretty clear but I don't understand how to solve it.

Fri Sep 29 05:59:36 2017 manage_users.cgi: (in cleanup) Can't connect to data source '' because I can't work out what driver to use (it doesn't seem to contain a 'dbi:driver:' prefix and the DBI_DRIVER env var is not set) at /usr/local/lib/perl5/site_perl/5.8.8/CGI/Session/Driver/DBI.pm line 26

I guess that message is coming from DBI.pm..

# extract dbi:driver prefix from $dsn into $1 $dsn =~ s/^dbi:(\w*?)(?:\((.*?)\))?://i or '' =~ /()/; # ensure $1 etc are empty if match fails my $driver_attrib_spec = $2 || ''; # Set $driver. Old style driver, if specified, overrides new dsn s +tyle. $driver = $old_driver || $1 || $ENV{DBI_DRIVER} or Carp::croak("Can't connect to data source '$dsn' " ."because I can't work out what driver to use " ."(it doesn't seem to contain a 'dbi:driver:' prefix " ."and the DBI_DRIVER env var is not set)");

Replies are listed 'Best First'.
Re^3: DBI Problem
by hippo (Archbishop) on Sep 29, 2017 at 12:46 UTC
    When I tried to reduce to a small block of code the problems disappeared so it was not an example.

    That's precisely the point. If you cannot provide an SSCCE because the problem disappears then the problem is with your code and not with anything else.

    Your code is somehow (perhaps indirectly) calling DBI->connect without a proper DSN. That is the issue - it's up to you to find out where in your code this is occuring and fix it there.

      Exactly. That is what I am trying to do and have been for many hours.

      I thought I would ask here since someone might have some insight into this problem.