The `-rename_columns` param to `HTML::Table::FromDatabase` can include only the columns you want renamed, so just passing in `$args->{labels}` to it, without the need for the logic to create another hash containing all columns, should work, I would have thought.