print join("\t", '', sort keys %col_headings, 'Total'),"\n"; for my $from ( sort keys %from_to_bytes ) { print (( $from eq '~~TOTAL' ) ? 'Total' : $from ); print "\t$from_to_bytes{$from}{$_}" for (sort keys %{$from_to_bytes{$from}}); }