#!/usr/bin/perl use utf8; use strict; use warnings; use DBI; use Test::More; my @dbs = ('a/databaseTest1.db', "\N{LATIN SMALL LETTER U WITH DIAERESIS}/databaseTest2.db"); plan tests => 7 * @dbs; for my $db (@dbs) { dbt ($db) } exit; sub dbt { my $dbname = shift; my $dbh = DBI->connect("dbi:SQLite:$dbname", "", "", { RaiseError => 1, AutoCommit => 1, PrintError => 1 }); ok ($dbh, "Creating database $dbname"); ok ($dbh->do( "CREATE TABLE data ( ID INTEGER PRIMARY KEY, text, filename)" ), "Created table data"); ok ($dbh->disconnect, "Disconnected from $dbname"); ok (-e $dbname, "Database file exists"); $dbh = DBI->connect("dbi:SQLite:$dbname", "", "", { RaiseError => 1, AutoCommit => 1, PrintError => 1 }); ok ($dbh, "Reconnected to database $dbname"); my $AllDbText_ref = $dbh->selectall_arrayref("SELECT filename FROM data"); ok (defined $AllDbText_ref, "Results set obtained from $dbname"); ok ($dbh->disconnect, "Disconnected from $dbname"); }