The
format directive is pretty frozen and inflexible, although it's always worthy of asking a question because there might be some arcane mechanism to influence it to get your desired behavior. In this case, no. {grin}
However, this piece of code can be dropped in to your program rather easily:
sub pad_string {
my $string = shift;
my $desired_length = shift;
my $pad_character = shift || " ";
substr($string,0,0) = $pad_character x ($desired_length - length $st
+ring);
$string;
}
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.