Organization of data in table form is a time-honored and useful method of data representation.
While columns of data are trivially generated by computer through formatted output, even simple tasks like keeping titles aligned with the data columns are not trivial, and the one-shot solutions one comes up with tend to be particularly hard to maintain.
Text::Table is a Perl module that allows you to create and maintain tables that adapt to alignment requirements as you use them.
my $tb = Text::Table->new(
"Planet", "Radius\nkm", "Density\ng/cm^3"
[ "Mercury", 2360, 3.7 ],
[ "Venus", 6110, 5.1 ],
[ "Earth", 6378, 5.52 ],
[ "Jupiter", 71030, 1.3 ],
This prints a table from the given title and data like this:
Planet Radius Density
Mercury 2360 3.7
Venus 6110 5.1
Earth 6378 5.52
Jupiter 71030 1.3
Note that two-line titles work, and that the planet names are aligned differently than the numbers.