The first sprintf argument is just a string:
my $zerofill = 9;
my $number = 1000;
my $filled = sprintf "%0${zerofill}d", $number;
Pay attention to braces to separate the variable name from the rest of the string.
We have this particular issue as a slightly smart exercise in Learning Perl to remind people that strings are just strings. :)
, mobrule , sprintf , โโ. , , , .