while ($boxLine =~ s/(\.+)/sprintf("%-*d", length($1), $wordNum)/e) { $wordNum++ }