Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl And Sqlite

Tags:

sqlite

perl

Can someone tell me how to access a sqlite3 database from perl.

the code

use DBI;
use DBD::SQLite;

my $dbh = DBI->connect(
  "dbi:SQLite:dbname=/cbilldata/media/database/collector.db","",""
) or die "Cannot connect: $DBI::errstr";

returns error

DBI connect('dbname=/cbilldata/media/database/collector.db','',...) failed: database disk image is malformed at ./db.pl line 7
Cannot connect: database disk image is malformed at ./db.pl line 7.

like image 798
yambu Avatar asked Aug 05 '26 08:08

yambu


1 Answers

Either your version of DBD::SQLite is a very old one that uses SQLite 2 and not 3, or the message is accurate and your database is corrupt.

like image 64
hobbs Avatar answered Aug 07 '26 02:08

hobbs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!