my $hello = sprintf "Hai %s! Time: %s\n" => $name, scalar(localtime); #### $results = array(); foreach ($tables as $table) { $sql = sprintf(" SELECT id, %s as customer, status, status_error, submit_datetime, FROM stats.%s WHERE direction = %s ", $config['customer_field'], $table, $config['direction'], ); $results[$table] = $dbh->exec( $sql ); } return $results;