in reply to Dynamical formating with sprintf?
Also if you have a lot of fields using the same width you can specify the width once and refer to it in the other fields:
$ perl -le'print sprintf q(%*s%*1$s%*1$s%*1$s%*1$s), 10, qw(one two th +ree four five)' one two three four five
|
|---|