in reply to printf & sprintf: variable number formats
use strict; use warnings; use constant LEN => 5; my $n = 12; my $str = '0' x (LEN-length($n)) . $n; print "$str"; [download]
00012 [download]