in reply to Question of variable interpolation in regex

When what I want is +----+----+----+----+ |1 |2 |3 |4 | | | | | | | | | | | +----+----+----+----+
Well, you'll need somthing like:
while ($boxLine =~ s/(\.+)/sprintf("%-*d", length($1), $wordNum)/e) { $wordNum++ }
But then you'll have to skip over the other lines which have blanks (you have multiple lines per square).