my $dbpath = 'C:/my/path/stats.db'; my $dsn = "dbi:SQLite:$dbpath"; my $dbh = DBI->connect( $dsn, '', '', { RaiseError => 1, AutoCommit => 1 } ); #### package My::Schema; use strict; use warnings; use base qw/DBIx::Class::Schema::Loader/; __PACKAGE__->loader_options( relationships => 1 ); 1; #### package My::Pkg; use strict; use warnings; use My::Schema; my $dbpath = 'C:/my/path/stats.db'; my $dsn = "dbi:SQLite:$dbpath"; my $schema = My::Schema->connect( $dsn, '', '', { RaiseError => 1, AutoCommit => 1 } );