use warnings; use strict; my $col=10; my $maxcol=40; my $str = ' ' x $col%$maxcol;