my @tables = $dbh->tables(); $qry = qq{SELECT * FROM ?}; $sth = $dbh->prepare( $qry ); foreach $table ( @tables ) { $sth->bind_param( 1, $table ); $sth->execute(); $row = $sth->fetchrow_hashref(); ......