in reply to I fear my code is unreadable

For printing data in automatically sized column widths, I often use Text::Table. It may be worth considering.