Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

hex (3272)

hex
  (email not shown publicly)
http://downlode.org/

Perl, RDF and wiki hacker, London, UK. This is my former Perl blog; I now write at Earle's Notebook [downlode.org].

Journal of hex (3272)

Thursday November 20, 2003
06:08 AM

Laziness: not *always* a virtue

[ #15898 ]

I just spent about three quarters of an hour trying to debug a bizarre DBI-related error that appeared this morning. I was getting this message:

DBI connect('db=/home/earle/Work/Thing/lib/Thing/thing.db','',...) failed: unable to open database: db=/home/earle/Work/Thing/lib/Thing/thing.db at /home/earle/Work/Thing/lib/Thing/DB.pm line 40

Googling for "DBI connect" "unable to open database" gets only 5 hits, and two of those are posts to the Siesta development list. It wasn't until I did a diff against an earlier version of the code that I found the problem:

-my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "",
+my $dbh = DBI->connect("dbi:SQLite:db=$db", "", "",

I'd decided before the end of yesterday to remame the variable $dbname to $db, because it contains a path as well as just a database name. And so I did a global search-and-replace and promptly clobbered the DBI connect string. Oops. (Of course, it would have helped if DBI had given me a slightly more informative error message....)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.