The number between "%" and "s" determines the minimum total size of the field, not the size of the padding. Padding will be added to expand the string being formatted to take up the entire field.
Prefixing your string with the result of ' ' x ($level * 4) is what you are actually asking for.
In reply to Re: sprintf problem
by ikegami
in thread sprintf problem
by walkingthecow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |