http://www.perlmonks.org?node_id=792514


in reply to How do I print a hash so that it represents actual table with column headers?

Text::Table can be used to format the keys and values of a simple hash as a 2-column table. It automatically calculates the width of each column.
use Text::Table; my $tb = Text::Table->new(qw(Keys Values)); # column headers for my $k (keys %hash) { $tb->add($k, $hash{$k}) } print $tb;
  • Comment on Re: How do I print a hash so that it represents actual table with column headers?
  • Download Code