use strict; use warnings; use DBI; my $dbh = DBI->connect(...); my $tables = $dbh->selectall_arrayref('show tables'); print "$_->[0]\n" for @$tables;