in reply to Re: Cross-platform DB
in thread Cross-platform DB

OK, being new to this, I am really beginning to feel dense. I downloaded SQLite, but don't know what to do with it. What do you do with a .kit file????

I also tried DBMDeep, but couldn't get it to work from the docs. I ran the "makefile.pl", and received the following:

J:\BSACamps.tst\CGI\DBM-Deep-0.99_04>perl makefile.pl Checking if your kit is complete... Looks good Warning: prerequisite Clone 0.01 not found. Warning: prerequisite FileHandle::Fmode 0.05 not found. Warning: prerequisite Test::Deep 0.095 not found. Warning: prerequisite Test::Exception 0.21 not found. Writing Makefile for DBM::Deep
I created their test program:
#!/usr/bin/perl use DBM::Deep; my $db = new DBM::Deep "foo.db"; $db->{mykey} = "myvalue";
but received the following when I went to run it:
Can't locate DBM/Deep.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/s +ite/lib .) at test.cgi line 2. BEGIN failed--compilation aborted at test.cgi line 2.

Replies are listed 'Best First'.
Re^3: Cross-platform DB
by derby (Abbot) on Feb 21, 2007 at 17:47 UTC

    for sqlite, (shamelessly lifted from the cookbook):

    #!/usr/bin/perl use strict; use warnings; use DBI; # what's your data look like? my %monks = ( '8930' => 'derby', '581658' => 'wpahiker', '961' => 'Anonymous Coward', '104919' => 'perrin' ); # create the database handle my $dbh = DBI->connect( "dbi:SQLite:monastery.dat" ); # create a table $dbh->do( "CREATE TABLE monks (id INTEGER PRIMARY KEY, name)" ); # insert values foreach my $monkid ( keys %monks ) { $dbh->do( "INSERT INTO monks VALUES ($monkid, '$monks{$monkid}')" ); } # fetch data my $sql = "select * from monks"; my $res = $dbh->selectall_arrayref( $sql ); foreach my $rec (@$res) { print "$rec->[1] is $rec->[0]\n"; } $dbh->disconnect;

    -derby
      Still getting the same error, thinking something wasn't installed where it should be:
      J:\BSACamps.tst\CGI>perl test.cgi Can't locate DBI.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/l +ib .) at test.cgi line 6. BEGIN failed--compilation aborted at test.cgi line 6.
      Line 6 is the "use dbi;"

        You need to install DBI and DBD::SQLite. As others have asked, what perl are you using? If Activestate, then by using ppm, these dependencies are auto-magically resolved for you.

        -derby
Re^3: Cross-platform DB
by marto (Cardinal) on Feb 22, 2007 at 09:25 UTC
Re^3: Cross-platform DB
by Anonymous Monk on Feb 21, 2007 at 16:55 UTC
    Are you using ActivePerl? If so, why not just install DBM::Deep from the PPM? (As DBM-Deep) Recent ActivePerl releases include PPM v4, which is GUI based :)

      Ahhh ... now I get it. Yes, aren't you using ActivePerl? If so, use ppm to install whatever module you need/want. If not, what version of perl are you using? Strawberry? Indigo? Cygwin?

      -derby
Re^3: Cross-platform DB
by Anonymous Monk on Feb 21, 2007 at 21:19 UTC
    I think you may have skipped a step or two on the module install... Usually it's:

    perl makefile.pl make make install

    See if that helps?