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


in reply to how to printf a matrix like this

Hi,

IMHO the most generic approach would be to store the result matrix into an array of arrays. While doing so, you could remember the most needed space for a column. After that you know the minimum space for each column and the adjustment needed when printing. After that you print each row of the array of arrays knowing how to adjust the length of the output.

Regards
McA