#!/usr/bin/perl -w

use strict ;

use DBI ;
use Data::Dumper ;

my $dbh = DBI->connect('dbi:DBM:mldbm=Storable')
  or die "Cannot connect to 'database': $DBI::errstr" ;
print "Version information:\n" ;
print join( "\n", $dbh->dbm_versions ), "\n" ;

eval {
  print "List of tables:", "\n" ;
  print join( "\n", $dbh->func('list_tables')), "\n" ;
} or warn $@ ;

eval {
  $dbh->do( <<QUERY );
CREATE TABLE IF NOT EXISTS tickets
 (tid TEXT PRIMARY KEY
 , user_id INTEGER
 , started DATE
 , status_f VARCHAR(16)
 , value_f VARCHAR(255)
 )
QUERY
} or warn $dbh->errstr ;


$dbh->disconnect ;
