Question: I need to buff out a line of text with a varying but large number of whitespace. I can figure out a janky way of doing a loop and adding whitespace to $foo, then splicing that into the text, but it is not an elegant solution.

Answer: 
If you always want the string to be a certain length you can use [`sprintf`](http://perldoc.perl.org/functions/sprintf.html):

For example, to pad out `$var` with white space so it 20,000 characters long use:

```
$var = sprintf("%-20000s",$var);

```
use the 'x' operator:

```
print ' ' x 20000;

```