use strict; use warnings; use Tk; use DBD::SQLite; my $mw = new MainWindow; my $types = [ ['Text', '.db'], ['All Files', '*'],]; my $file= $mw->getOpenFile(-filetypes => $types); my $shortpath=Win32::GetANSIPathName($file); #for path with accents my $path_and_databasename=$shortpath; my $lco; #connecting to sqlite my $dbh = DBI->connect("dbi:SQLite:$path_and_databasename", "", "", { RaiseError => 1, AutoCommit => 1, PrintError => 0 }); my $all = $dbh->selectall_arrayref("SELECT language FROM metadata"); foreach my $row_db (my @all) { ($lco) = @$row_db; } print "Connected: $lco\n";