# This is the sample application. Change this to the path to your
# database. (or use mysql or something)
use constant DBI_DRIVER => 'SQLite';
-use constant DATASOURCE => 't/beerdb.db';
+use constant DATASOURCE => $ENV{BEERDB_DATASOURCE} || 't/beerdb.db';
BEGIN {
my $dbi_driver = DBI_DRIVER;
unless -e DATASOURCE;
eval "require DBD::SQLite";
if ($@) {
- eval "require DBD::SQLite2" && dbi_driver = 'SQLite2';
+ eval "require DBD::SQLite2" and $dbi_driver = 'SQLite2';
}
}
BeerDB->setup(join ':', "dbi", $dbi_driver, DATASOURCE);