in reply to Returning an array the way it was written

It helps to be specific, by:

print(select, [%names]);

Did you really mean using Text::CSV:

$csv->print(select, [%names]);

In the same way you were advised here? Please read and understand How do I post a question effectively?.