Hi guys, I'm pretty new to CGI programming. I have a question here, I'm working on a poll script, but could not understand what does this line mean?

foreach my $key (keys %results) {
my $percent = ($results{$key} / $total_votes ) * 100;
$percents{$key} = sprintf("%2d %%", $percent);
}

The main part is that sprintf("%2d %%", $percent), what does sprintf mean? And what are those %2d %%?

Thanks.