my $ref = $sth->fetchall_hashref([$name_col,$val_col]); $sth->finish(); return map {@$_} @$ref;