$foo = sprintf(....);
$foo =~ s/^ +/z/;
Formats might help you depending on what you're trying to accomplish:
[perldoc.com...]
Sean
$foo = "hi ho";
print sprintf("%15s",$foo);
Now, I'd really like that to be **********hi ho, but using a regexp to replace the spaces would result in **********hi*ho, which is not what I want :)
I guess I'll just have to count the string length, and pad manually. :)