An alternative to
printf is
Text::Table, which automatically calculates the width of each column for you. So, if all you want is basic tabular output, and you really don't care if column 1 is 27 wide, or 36 wide, just let
Text::Table do the work for you.