in reply to output format changed perl5.8 --> perl 5.10?

Precision in an integer makes not so much sense. It gets repurposed for a slightly different meaning. From the perldoc on sprintf one can find this:

For integer conversions, specifying a precision imp +lies that the output of the number itself should be zero +-padded to this width, where the 0 flag is ignored: printf '<%.6d>', 1; # prints "<000001>" printf '<%+.6d>', 1; # prints "<+000001>" printf '<%-10.6d>', 1; # prints "<000001 >" printf '<%10.6d>', 1; # prints "< 000001>" printf '<%010.6d>', 1; # prints "< 000001>" printf '<%+10.6d>', 1; # prints "< +000001>" printf '<%.6x>', 1; # prints "<000001>" printf '<%#.6x>', 1; # prints "<0x000001>" printf '<%-10.6x>', 1; # prints "<000001 >" printf '<%10.6x>', 1; # prints "< 000001>" printf '<%010.6x>', 1; # prints "< 000001>" printf '<%#10.6x>', 1; # prints "< 0x000001>"

Either drop the precision portion or set it to 2. There are other options which provide the proper output but maybe shouldn't.

printf "<%.2d>\n", 5; printf "<%02.2d>\n", 4; printf "<%02d>\n", 3; printf "<%02.0d>\n", 2; printf "<%0.2d>\n", 1; printf "<%1.2d>\n", 0;
prints:
<05> <04> <03> < 2> <01> <00>

The first three options there make sense to me, although the first in an ugly sort of way. The fourth, as you're finding out, is having the precision portion ignored as per the documentation. The fifth and sixth I would consider undocumented behavior and subject to change.

Update:
In the Perl 5.8.8 documentation, it says something similar, and I consider the behavior of padding to 2 in the %02.0d case to be a bug in that version.:

For integer conversions, specifying a precision imp +lies that the output of the number itself should be zero-padded to th +is width: printf ’<%.6x>’, 1; # prints "<000001>" printf ’<%#.6x>’, 1; # prints "<0x000001>" printf ’<%-10.6x>’, 1; # prints "<000001 >"