Expanding on
shigetsu's notion of using formatting (which I agree would be the best method here), you may want to look into
Perl6::Form (Perl 6's version of
format). It is more straightforward than what is being used in Perl 5 and will soon become the standard anyway.