my %db_tables; my @db_list = `ls -1U`; for my $db_name (@db_list) { eval { my $DB = DBI->connect("dbi:SQLite:dbname=$db_name"); my $ST = $DB->table_info(undef, undef, 'TABLE'); while (my $hr = $ST->fetchrow_hashref) { $db_tables{$hr->{TABLE_NAME}}{$db_name}=0; } }; if ($@) { print "Skipping $db_name (Not a database? '$@'\n"; } } for my $tbl (sort keys %db_tables) { print "TABLE: $tbl\nDBs: ", join(", ", @{$db_tables{$tbl}}), "\n\n"; }