[问题] 请问 -$ 代表的意义是?

楼主: freeaircraft (step~by~step)   2012-09-06 22:46:04
小弟不才,看书时对于下面程式码的某一段有些疑问,
my $longest=0;
foreach my $key (keys %ENV)
{
my $key_length=length($key);
$longest = $key_length if $key_length > $longest;
}
foreach my $key (sort keys %ENV)
{
printf "%-${longest}s %-s\n", $key, $ENV{$key}
}
想请问板上大大倒数第二行
printf "%-${longest}s %-s\n", $key, $ENV{$key} 里的 -${longest}s 中
"-$"代表的是什么意思??
Thanks in advance!
作者: blackkaku (black)   2012-09-08 19:40:00
靠左对齐

Links booklink

Contact Us: admin [ a t ] ucptt.com