use SQL; my @tables; SQL::Connect "debloat", "localhost"; SQL::xqt "SHOW TABLES"; my $i = 0; while (my @ary = $SQL::sth->fetchrow_array ()) { $tables[$i] = @ary; $i++; } foreach (@tables) { print "$_\n"; }